- Notifications
You must be signed in to change notification settings - Fork425
fixed read timeout in chucked content response for sync keep-alive client#327
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
nit: I would prefer you call this variablebytes_to_read.
deanberris commentedNov 24, 2013
Generally, LGTM -- but if you have time to address that nit, I would appreciate it very much. :) Thanks@mepahoo ! |
deanberris commentedNov 24, 2013
Cool, thanks -- this LGTM. Sorry for the delay, I didn't know it was ready for another look. :) |
fixed read timeout in chucked content response for sync keep-alive client
fixed read timeout in chucked content response for sync keep-alive client
After some testing, i noticed the keep-alive sync http client waited about 20 seconds before returning a trivial content (about 111 bytes). I tracked it down to this fix. The problem was that boost::asio::read is called, even if there are enough bytes in the current stream buffer. This causes read to wait until timeout (which on my windows platform was 20 secs, apparently). The fix is to not read if there are enough bytes in the current stream buffer. I am also counting 2 extra bytes for "\r\n" that comes after each chunk.