fixed bug introduced in last commit which made the server send two '200 OK' in send-functions, fixed socket not closing properly due to file descriptor copy in forked process