wwbmmm commented on code in PR #2210:
URL: https://github.com/apache/brpc/pull/2210#discussion_r1178594486


##########
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:
   Maybe we can add a flag `has_progressive_read_method` to Server
   When Server Start, check all MethodProperty, if any one has progressive_read 
option, set `has_progressive_read_method` to true
   When parsing message, check `has_progressive_read_method`, if true, then 
call FindMethodPropertyByURI 



-- 
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]

Reply via email to