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

Make get_request timeouts recoverable #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

oalders
Copy link
Member

@oalders oalders commented Mar 29, 2019

Originally gisle/http-daemon#1

With short select() delays (e.g. in event loops) and slow connections,
the client may not have more data ready before select timeouts.

This change lets get_request return a different kind of false (defined
instead of undef) in case of a select timeout, so that the caller can
choose to call it again. To make this work, the same buffer
is re-used with _need_more every time.

Hacks that inherit from HTTP::Daemon and override _need_more, will
break, as will existing code that explicitly tests the result of
get_request for definedness rather than its boolean value, and then
assumes that it will be an HTTP::Request object. Both cases are
unlikely.

The unit test is based on chunked.t with a lot removed.
@oalders
Copy link
Member Author

oalders commented Mar 29, 2019

I haven't reviewed this code. Just ported it over now so I wouldn't forget.

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

Successfully merging this pull request may close these issues.

2 participants