Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support HTTP requests that are sent in arbitrary number of chunks #48

Open
arrizer opened this issue Mar 19, 2016 · 1 comment
Open

Comments

@arrizer
Copy link

arrizer commented Mar 19, 2016

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.

@arrizer
Copy link
Author

arrizer commented May 1, 2016

I just updated the pull request and resolved merge conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant