From f0273e21b60c807d51879c2e210538c73d507f8b Mon Sep 17 00:00:00 2001 From: Baoyi Date: Wed, 28 Oct 2020 18:07:07 +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 --- .../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 2403d6d42e83..633d13815c1e 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 @@ -211,7 +211,7 @@ protected void decompress(ByteAccumulator accumulator, ByteBuffer buf) throws Da read = inflater.inflate(output); if (read <= 0) { - if (read == 0 && LOG.isDebugEnabled()) + if (LOG.isDebugEnabled()) LOG.debug("Decompress: read 0 {}", toDetail(inflater)); break; }