runzhiwang commented on a change in pull request #294:
URL: https://github.com/apache/incubator-ratis/pull/294#discussion_r529119150



##########
File path: 
ratis-netty/src/main/java/org/apache/ratis/netty/NettyDataStreamUtils.java
##########
@@ -101,7 +101,7 @@ static DataStreamReplyByteBuffer 
decodeDataStreamReplyByteBuffer(ByteBuf buf) {
         .map(header -> checkHeader(header, buf))
         .map(header -> DataStreamReplyByteBuffer.newBuilder()
             .setDataStreamReplyHeader(header)
-            .setBuffer(decodeData(buf, header, ByteBuf::nioBuffer))
+            .setBuffer(decodeData(buf, header, b -> b.copy().nioBuffer()))

Review comment:
       @szetszwo Sorry, miss this. Why we need b.copy() ?




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to