Skip to content

Commit

Permalink
use heap buffers in the default payload decoder (#945)
Browse files Browse the repository at this point in the history
  • Loading branch information
SerCeMan authored Oct 13, 2020
1 parent 4e379f1 commit 088cad9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ public Payload apply(ByteBuf byteBuf) {
throw new IllegalArgumentException("unsupported frame type: " + type);
}

ByteBuffer data = ByteBuffer.allocateDirect(d.readableBytes());
ByteBuffer data = ByteBuffer.allocate(d.readableBytes());
data.put(d.nioBuffer());
data.flip();

if (m != null) {
ByteBuffer metadata = ByteBuffer.allocateDirect(m.readableBytes());
ByteBuffer metadata = ByteBuffer.allocate(m.readableBytes());
metadata.put(m.nioBuffer());
metadata.flip();

Expand Down

0 comments on commit 088cad9

Please sign in to comment.