From 2c5ab59c9d6e8998a7de0e1bfe642d9b0315ac85 Mon Sep 17 00:00:00 2001 From: Lachlan Roberts Date: Wed, 17 Mar 2021 19:03:10 +1100 Subject: [PATCH] Issue #6050 - use compressed and decompressed as variable names Signed-off-by: Lachlan Roberts --- .../extensions/compress/CompressExtension.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 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 169db02c4429..14bdf0bdfb45 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 @@ -199,13 +199,13 @@ protected void decompress(ByteAccumulator accumulator, ByteBuffer buf) throws Da { // The buffer returned by the accumulator might not be empty, so we must append starting from the limit. ByteBuffer buffer = accumulator.ensureBuffer(DECOMPRESS_BUF_SIZE); - int written = inflater.inflate(buffer.array(), buffer.arrayOffset() + buffer.limit(), buffer.capacity() - buffer.limit()); - buffer.limit(buffer.limit() + written); - accumulator.addLength(written); + int decompressed = inflater.inflate(buffer.array(), buffer.arrayOffset() + buffer.limit(), buffer.capacity() - buffer.limit()); + buffer.limit(buffer.limit() + decompressed); + accumulator.addLength(decompressed); if (LOG.isDebugEnabled()) - LOG.debug("Decompressed {} bytes into buffer {} from {}", written, BufferUtil.toDetailString(buffer), toDetail(inflater)); + LOG.debug("Decompressed {} bytes into buffer {} from {}", decompressed, BufferUtil.toDetailString(buffer), toDetail(inflater)); - if (written <= 0) + if (decompressed <= 0) break; } } @@ -498,13 +498,13 @@ private void compress(FrameEntry entry, boolean first) { // The buffer returned by the accumulator might not be empty, so we must append starting from the limit. ByteBuffer buffer = accumulator.ensureBuffer(8, outputLength); - int written = deflater.deflate(buffer.array(), buffer.arrayOffset() + buffer.limit(), buffer.capacity() - buffer.limit(), Deflater.SYNC_FLUSH); - buffer.limit(buffer.limit() + written); + int compressed = deflater.deflate(buffer.array(), buffer.arrayOffset() + buffer.limit(), buffer.capacity() - buffer.limit(), Deflater.SYNC_FLUSH); + buffer.limit(buffer.limit() + compressed); if (LOG.isDebugEnabled()) LOG.debug("Wrote {} bytes to output buffer", accumulator); - if (written <= 0) + if (compressed <= 0) break; }