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 633d13815c1e..8eabd578efc0 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 @@ -209,7 +209,11 @@ protected void decompress(ByteAccumulator accumulator, ByteBuffer buf) throws Da { byte[] output = accumulator.newByteArray(DECOMPRESS_BUF_SIZE); read = inflater.inflate(output); - if (read <= 0) + if (read < 0) + { + break; + } + else if (read == 0) { if (LOG.isDebugEnabled()) LOG.debug("Decompress: read 0 {}", toDetail(inflater));