TangSiyang2001 commented on code in PR #2210:
URL: https://github.com/apache/brpc/pull/2210#discussion_r1177586772
##########
src/brpc/policy/http_rpc_protocol.cpp:
##########
@@ -1145,16 +1146,20 @@ ParseResult ParseHttpMessage(butil::IOBuf *source,
Socket *socket,
if (http_imsg->Completed()) {
CHECK_EQ(http_imsg, socket->release_parsing_context());
const ParseResult result = MakeMessage(http_imsg);
+ http_imsg->CheckProgressiveRead(arg, socket);
if (socket->is_read_progressive()) {
socket->OnProgressiveReadCompleted();
}
return result;
- } else if (socket->is_read_progressive() &&
- http_imsg->stage() >= HTTP_ON_HEADERS_COMPLETE) {
- // header part of a progressively-read http message is complete,
- // go on to ProcessHttpXXX w/o waiting for full body.
- http_imsg->AddOneRefForStage2(); // released when body is fully
read
- return MakeMessage(http_imsg);
+ } else if (http_imsg->stage() >= HTTP_ON_HEADERS_COMPLETE) {
+ http_imsg->CheckProgressiveRead(arg, socket);
Review Comment:
Oh I got u. However, one of the keypoints of this feature is to get the
corresponding service opt `enable_progressive_read` after header completed and
determine the read body behavior. Is there a better way to get this opt without
calling `FindMethodPropertyByURI` to fetch it inside the method property?
Appreciate it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]