Paragrf commented on code in PR #3002:
URL: https://github.com/apache/brpc/pull/3002#discussion_r2176269947


##########
src/brpc/policy/http_rpc_protocol.cpp:
##########
@@ -1331,7 +1331,26 @@ ParseResult ParseHttpMessage(butil::IOBuf *source, 
Socket *socket,
     }
 }
 
-static void SendUnauthorizedResponse(const std::string& user_error_text, 
Socket* socket) {
+static void SendUnauthorizedResponse(const std::string& user_error_text, 
Socket* socket, const InputMessageBase* msg) {
+    HttpContext* http_request = (HttpContext*)msg;
+    const bool is_http2 = http_request->header().is_http2();
+    if (is_http2) {
+        // for grpc client
+        const H2StreamContext* h2_sctx = static_cast<const 
H2StreamContext*>(msg);
+        brpc::Controller* cntl = new brpc::Controller();

Review Comment:
   Sorry, I didn't understand you. I notice that line 1411 in 
ProcessHttpRequest is also handled in this way. Why is there no need for a new 
Controller here?



-- 
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: dev-unsubscr...@brpc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org

Reply via email to