Skip to content

Commit cce32b1

Browse files
committed
Merge #36379: fuzz: fix stale comments in http_request
3f7f845 fuzz: fix stale comments in http_request (frankomosh) Pull request description: Follow-up to #36135 (comment), fixing a false comment flagged in review. The comment says a completed request is always handed back to a worker. Since #36174 it stays in `m_req` when the send buffer is over MAX_BODY_SIZE. ACKs for top commit: pinheadmz: ACK 3f7f845 hodlinator: ACK 3f7f845 Tree-SHA512: 6f499c394f8e933ba8b5eccd8228f3a7f5e77f41b7e998712c67af004d23c557b7191ace1ad47980920fde802debc73efb9e9b7163db564d3f35086dfeb46b37
2 parents 649bc0a + 3f7f845 commit cce32b1

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎src/test/fuzz/http_request.cpp‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ using namespace bitcoin_http;
2727
namespace {
2828

2929
//! A fully parsed request must have a body consistent with its framing headers.
30-
//! Before libevent was replaced with HTTPRequest (#35182), ReadBody() always
31-
//! returned an empty string; LoadBody() now populates the body per RFC 9112
32-
//! framing, so mirror its branch logic here.
3330
void CheckBodyMatchesFraming(const HTTPRequest& req)
3431
{
3532
const std::string body{req.ReadBody()};
@@ -126,7 +123,10 @@ void Drain(const std::shared_ptr<FuzzClient>& client, RunResult& out)
126123

127124
if (!req) {
128125
if (const HTTPRequest* cur{client->GetRequest()}) {
129-
// Complete is always handed back, never left behind.
126+
// TryReadRequest() returns empty if the HTTPRemoteClient is still
127+
// holding on to the request. In this test, the request is guaranteed
128+
// to be incomplete or failed, although in production it may be a result of
129+
// a busy worker or a full send buffer.
130130
assert(cur->GetState() != HTTPRequest::State::Complete);
131131
assert(StateRank(cur->GetState()) >= StateRank(out.last_state));
132132
out.last_state = cur->GetState();

0 commit comments

Comments
 (0)