Skip to content

Conversation

@MungoG
Copy link
Collaborator

@MungoG MungoG commented Nov 5, 2025

This is a replacement PR for #57 as the source branch had to be recreated.

@cppalliance-bot
Copy link

cppalliance-bot commented Nov 5, 2025

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

@MungoG MungoG changed the title body_read_stream implementation body_read_stream implementation (replacement for PR 57) Nov 5, 2025
auto lambda2 = [&](system::error_code ec, std::size_t n)
{
BOOST_TEST_EQ(n, 0);
BOOST_TEST_EQ(ec, http_proto::error::incomplete);
Copy link
Collaborator

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?

Copy link
Collaborator Author

@MungoG MungoG Nov 11, 2025

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.

Copy link
Collaborator

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.

Copy link
Collaborator

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.

@MungoG MungoG marked this pull request as ready for review November 11, 2025 14:49
@MungoG MungoG force-pushed the issue-55-async-body-stream-impl-v3 branch from 2ca95d9 to b7afa53 Compare November 11, 2025 15:49
@MungoG MungoG force-pushed the issue-55-async-body-stream-impl-v3 branch from b7afa53 to 7b71549 Compare November 11, 2025 15:52
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.

3 participants