-
Notifications
You must be signed in to change notification settings - Fork 8
body_read_stream implementation (replacement for PR 57) #78
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
base: develop
Are you sure you want to change the base?
body_read_stream implementation (replacement for PR 57) #78
Conversation
|
An automated preview of the documentation is available at https://78.beast2.prtest3.cppalliance.org/index.html If more commits are pushed to the pull request, the docs will rebuild at the same URL. 2025-11-12 14:00:44 UTC |
| auto lambda2 = [&](system::error_code ec, std::size_t n) | ||
| { | ||
| BOOST_TEST_EQ(n, 0); | ||
| BOOST_TEST_EQ(ec, http_proto::error::incomplete); |
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.
Could you please explain why the second handler is expected to always complete with error::incomplete?
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.
This is because, after a cancellation, the test stream fires an initial operation_aborted callback, and thereafter any attempt to async_read from that previously cancelled test stream gives an eof callback.
This eof causes beast2::async_read_some to call pr_.commit_eof, as a result of which the parser's parse call returns error::incomplete.
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.
The behavior of test::stream is wrong then, it should just cancel the existing operation.
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.
@MungoG I'm working on a fix for test::stream cancellation. It should be merged within a couple of hours.
2ca95d9 to
b7afa53
Compare
b7afa53 to
7b71549
Compare
This is a replacement PR for #57 as the source branch had to be recreated.