Conversation
async_get() submits the request, ends its empty body, waits for the response and reads all of it, handing back a plain Beast message -- status, header fields and the body as a std::string, aliased as client::Message. What a simple GET spread over four steps is one asynchronous operation now, completion tokens and cancellation included. Sending an actual GET means the method can no longer be hardcoded: all three backends built their request with ":method: POST", so Session::Impl::async_submit() takes the method as a parameter. The public async_submit() still passes "POST", so nothing else changes on the wire. The request goes out with "Content-Length: 0" unless the caller frames a body itself. That keeps HTTP/1.1 from making a bodiless request chunked, and with it from counting the request as incomplete -- and the session as busy -- until the body is ended. The message that comes with an error is empty and says status::unknown, rather than the 200 a default-constructed Beast response would claim. test_get.cpp covers status, fields, body, request headers, an empty body, a 1 MiB one, two requests in a row and cancellation, for all three protocols, plus the request line as a raw HTTP/1.1 peer sees it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The header, file handler and client testcases that send no request body and read the response to its end say so in one line now. client::Message is a Beast fields, so expect_contains() and values_of() take it unchanged. FileHandler::get() was async_get() spelled out, and hands back the message itself instead of a (status, body) tuple. HeaderLimits::request() loses its two error checks along with the operations they belonged to. These requests go out as GET with "Content-Length: 0" now, instead of as a chunked POST -- which is what the testcases describe anyway. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.