From e131c7b445c48fe1ed7165afeffc71ff9f1f11cc Mon Sep 17 00:00:00 2001 From: Baoyi Chen Date: Thu, 29 Oct 2020 16:14:46 +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 --- .../common/extensions/compress/CompressExtension.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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 5e4d9bf56015..60dd1c997f74 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 @@ -47,11 +47,6 @@ public abstract class CompressExtension extends AbstractExtension protected static final ByteBuffer TAIL_BYTES_BUF = ByteBuffer.wrap(TAIL_BYTES); private static final Logger LOG = Log.getLogger(CompressExtension.class); - /** - * Accumulator - */ - protected ByteAccumulator accumulator; - /** * Never drop tail bytes 0000FFFF, from any frame type */ @@ -97,6 +92,7 @@ public abstract class CompressExtension extends AbstractExtension private InflaterPool inflaterPool; private Deflater deflaterImpl; private Inflater inflaterImpl; + protected ByteAccumulator accumulator; protected AtomicInteger decompressCount = new AtomicInteger(0); private int tailDrop = TAIL_DROP_NEVER; private int rsvUse = RSV_USE_ALWAYS;