lizhanhui commented on code in PR #5111:
URL: https://github.com/apache/rocketmq/pull/5111#discussion_r973820019


##########
remoting/src/main/java/org/apache/rocketmq/remoting/netty/FileRegionEncoder.java:
##########
@@ -52,7 +52,7 @@ protected void encode(ChannelHandlerContext ctx, FileRegion 
msg, final ByteBuf o
             @Override
             public int write(ByteBuffer src) throws IOException {
                 out.writeBytes(src);
-                return out.capacity();
+                return src.limit() - src.position();

Review Comment:
   To ensure absolute accuracy, just compare the writer index before and after



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

Reply via email to