jenrryyou commented on code in PR #2754:
URL: https://github.com/apache/brpc/pull/2754#discussion_r1746413816


##########
src/brpc/policy/baidu_rpc_protocol.cpp:
##########
@@ -266,7 +273,7 @@ void SendRpcResponse(int64_t correlation_id,
         // Response_stream can be INVALID_STREAM_ID when error occurs.
         if (SendStreamData(sock, &res_buf,
                            accessor.remote_stream_settings()->stream_id(),
-                           accessor.response_stream()) != 0) {
+                           accessor.response_streams()[0]) != 0) {

Review Comment:
   
Response_stream为INVALID_STREAM_ID不会造成越界,因为reponse_streams里还是有元素的。对端收到StreamData会在ProcessRpcResponse里处理
   
![image](https://github.com/user-attachments/assets/20b795d3-8877-46c4-a492-c3eb011b5742)
   
   
Response_stream为INVALID_STREAM_ID的情况的然后Response_stream为INVALID_STREAM_ID的时候,cntl一定会传errorcode回来,然后rpc会失败,endRPC里会关闭对端的stream.
   
   P.S. 返回INVALID_STREAM_ID的MR还是我之前提的



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