Skip to content

Drain Request Buffer After Calling the Handler Function #4

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

Closed
fhessel opened this issue Jan 8, 2018 · 1 comment
Closed

Drain Request Buffer After Calling the Handler Function #4

fhessel opened this issue Jan 8, 2018 · 1 comment
Assignees
Labels

Comments

@fhessel
Copy link
Owner

fhessel commented Jan 8, 2018

Currently, when the handler function is called and does not consume the whole request body (either due to an error or intended), the request body buffer will not be cleared (up to Content-Length bytes or its actual end).
This is especially a problem with Connection: keep-alive requests, as parsing the header line will start exactly where the callback function stopped consuming the body.
This should be changed to get the server more reliable, even if the callback function terminated unexpectedly.

@fhessel fhessel self-assigned this Jan 8, 2018
@fhessel fhessel added the bug label Mar 21, 2018
@fhessel
Copy link
Owner Author

fhessel commented Mar 26, 2018

The server will now drain the buffer and just print an error message to the log to notify the developer. Maybe this behavior has to be investigated in depth, as it might also be an alternative to close the connection as the handler clearly misbehaves here and that may be exploited in some way.

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

No branches or pull requests

1 participant