HTTP Server now working

Strangely enough adding error check to socket.read fixed the problem.