Skip to content

Commit

Permalink
fix h2 rpc_dump mem leak bug (#2661)
Browse files Browse the repository at this point in the history
  • Loading branch information
GreateCode authored Jun 13, 2024
1 parent 15469ed commit 2e18318
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/brpc/policy/http_rpc_protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1578,15 +1578,17 @@ void ProcessHttpRequest(InputMessageBase *msg) {
}
}
}
SampledRequest* sample = AskToBeSampled();
if (sample && !is_http2) {
sample->meta.set_compress_type(COMPRESS_TYPE_NONE);
sample->meta.set_protocol_type(PROTOCOL_HTTP);
sample->meta.set_attachment_size(req_body.size());

butil::EndPoint ep;
MakeRawHttpRequest(&sample->request, &req_header, ep, &req_body);
sample->submit(start_parse_us);
if (!is_http2) {
SampledRequest* sample = AskToBeSampled();
if (sample) {
sample->meta.set_compress_type(COMPRESS_TYPE_NONE);
sample->meta.set_protocol_type(PROTOCOL_HTTP);
sample->meta.set_attachment_size(req_body.size());

butil::EndPoint ep;
MakeRawHttpRequest(&sample->request, &req_header, ep, &req_body);
sample->submit(start_parse_us);
}
}
} else {
if (imsg_guard->read_body_progressively()) {
Expand Down

0 comments on commit 2e18318

Please sign in to comment.