You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "AlbumenJ (via GitHub)" <gi...@apache.org> on 2023/03/28 07:48:23 UTC

[GitHub] [dubbo] AlbumenJ commented on a diff in pull request #11885: Provider side payload checking

AlbumenJ commented on code in PR #11885:
URL: https://github.com/apache/dubbo/pull/11885#discussion_r1150168709


##########
dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/codec/ExchangeCodec.java:
##########
@@ -497,12 +497,12 @@ protected void encodeResponseData(Channel channel, ObjectOutput out, Object data
     }
 
     private Object finishRespWhenOverPayload(Channel channel, long size, byte[] header) {
-        int payload = getPayload(channel);
-        boolean overPayload = isOverPayload(payload, size);
-        if (overPayload) {
-            long reqId = Bytes.bytes2long(header, 4);
-            byte flag = header[2];
-            if ((flag & FLAG_REQUEST) == 0) {
+        byte flag = header[2];
+        if ((flag & FLAG_REQUEST) == 0) {
+            int payload = getPayload(channel);
+            boolean overPayload = isOverPayload(payload, size);
+            if (overPayload) {
+                long reqId = Bytes.bytes2long(header, 4);

Review Comment:
   What is the purpose of changing these lines?



##########
dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/DubboCodec.java:
##########
@@ -158,6 +158,11 @@ protected Object decodeBody(Channel channel, InputStream is, byte[] header) thro
                     req.setEvent(true);
                 } else {
                     req = new HeartBeatRequest(id);

Review Comment:
   Please help change to `Request` here. There is a mistake when recreating heart beat event.



-- 
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: notifications-unsubscribe@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org