shy-share opened a new issue #9354:
URL: https://github.com/apache/dubbo/issues/9354


   
在这个类中org.apache.dubbo.remoting.exchange.codec.ExchangeCodec#decode(org.apache.dubbo.remoting.Channel,
 org.apache.dubbo.remoting.buffer.ChannelBuffer, int, byte[])有下面两行代码:
           Object obj = finishRespWhenOverPayload(channel, len, header);
           checkPayload(channel, len);
   而在finishRespWhenOverPayload和checkPayload两个方法中都执行了这样的逻辑
   int payload = getPayload(channel);
   boolean overPayload = isOverPayload(payload, size);
   
   问题是
   如果 finishRespWhenOverPayload 返回的不是 null,没啥说的,返回 return 了,不会执行 checkPayload 
方法。
   
   如果 finishRespWhenOverPayload 返回的是 null,则会执行 checkPayload 方法,但是checkPayload 
方法中的逻辑是这样的
           if (overPayload) {
               ExceedPayloadLimitException e = new ExceedPayloadLimitException(
                       "Data length too large: " + size + ", max payload: " + 
payload + ", channel: " + channel);
               logger.error(e);
               throw e;
           }
   finishRespWhenOverPayload 
返回的是null,overPayload就为false了,这段逻辑就不会执行,因此这个checkPayload方法其实没有必要,建议删除。


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