The current implementation of the SocketServer only supports HTTP requests that are sent in 1 or 2 chunks, with the additional requirement of the "Content-Length" header being fully contained in the first chunk for POST and PUT requests. HTTP requests however can be sent in an arbitrary number of chunks and a server must only process the request, after all headers and the full body was received.
On a fast localhost connection an additional problem occurs:
The current implementation checks if the body was contained in the first chunk, if not, it just calls read() on the socket. But in many cases, the body data is not available on the socket yet, which will result in a socket read error 35 (EAGAIN) and the body data is silently dropped.
I issues a pull request that should fix the above issues. There are still some memory leaks when handling massive amounts of requests, those should be addressed separately.
The current implementation of the SocketServer only supports HTTP requests that are sent in 1 or 2 chunks, with the additional requirement of the "Content-Length" header being fully contained in the first chunk for POST and PUT requests. HTTP requests however can be sent in an arbitrary number of chunks and a server must only process the request, after all headers and the full body was received.
On a fast localhost connection an additional problem occurs: The current implementation checks if the body was contained in the first chunk, if not, it just calls read() on the socket. But in many cases, the body data is not available on the socket yet, which will result in a socket read error 35 (EAGAIN) and the body data is silently dropped.
I issues a pull request that should fix the above issues. There are still some memory leaks when handling massive amounts of requests, those should be addressed separately.