RainYuY commented on PR #16404:
URL: https://github.com/apache/dubbo/pull/16404#issuecomment-5173996344

   > ```
   >         if (isServerSide(channel)
   >                 && readable > 1
   >                 && (buffer.getByte(buffer.readerIndex()) != MAGIC_HIGH
   >                         || buffer.getByte(buffer.readerIndex() + 1) != 
MAGIC_LOW)) {
   >             checkPayload(channel, readable);
   >         }
   > ```
   > 
   > It may be sufficient to only handle cases greater than 1
   
    I don't think this change provides any meaningful behavioral benefit. When 
readable == 1, checkPayload is effectively a no-op because the smallest 
positive payload limit is 1, and the check only rejects size > payload. The 
current condition is correct and keeps the zero-readable case explicit, so I'd 
prefer to leave it as is.


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