You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/09/19 02:04:48 UTC
[GitHub] [rocketmq] lizhanhui commented on a diff in pull request #5111: Update FileRegionEncoder.java
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: dev-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org