From dd0c63c49c5fa5b4306ad896116b46727bfa5906 Mon Sep 17 00:00:00 2001 From: Baoyi Chen Date: Fri, 30 Oct 2020 12:31:33 +0800 Subject: [PATCH] Fix issue #5499 this PR let the ByteAccumulator recyclable. after invoke ByteAccumulator.transferTo method we can invoke ByteAccumulator.recycle method to reuse byte[] via ByteAccumulator.newByteArray method Signed-off-by: Baoyi Chen --- .../websocket/common/extensions/compress/CompressExtension.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/extensions/compress/CompressExtension.java b/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/extensions/compress/CompressExtension.java index a7ecade99151..f7fbb6a1c1cc 100644 --- a/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/extensions/compress/CompressExtension.java +++ b/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/extensions/compress/CompressExtension.java @@ -179,7 +179,7 @@ protected ByteAccumulator newByteAccumulator() int maxSize = Math.max(getPolicy().getMaxTextMessageSize(), getPolicy().getMaxBinaryMessageSize()); if (accumulator == null || accumulator.getMaxSize() != maxSize) { - accumulator = new ByteAccumulator(maxSize); + accumulator = new ByteAccumulator(maxSize, getBufferPool()); } return accumulator; }