From 91ee0e5a56d13a5cbcdfd42fa8d93b1ebc1f8d7a Mon Sep 17 00:00:00 2001 From: Jeff Pinner Date: Fri, 28 Jun 2013 13:35:29 -0700 Subject: [PATCH] SPDY: SpdyHeaderBlockDecoder should not discard input data --- .../netty/handler/codec/spdy/SpdyHeaderBlockRawDecoder.java | 4 ---- .../netty/handler/codec/spdy/SpdyHeaderBlockZlibDecoder.java | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/java/org/jboss/netty/handler/codec/spdy/SpdyHeaderBlockRawDecoder.java b/src/main/java/org/jboss/netty/handler/codec/spdy/SpdyHeaderBlockRawDecoder.java index 8e4e94c54d..6c1f45040f 100644 --- a/src/main/java/org/jboss/netty/handler/codec/spdy/SpdyHeaderBlockRawDecoder.java +++ b/src/main/java/org/jboss/netty/handler/codec/spdy/SpdyHeaderBlockRawDecoder.java @@ -82,7 +82,6 @@ public class SpdyHeaderBlockRawDecoder extends SpdyHeaderBlockDecoder { // Try to read length of name if (encoded.readableBytes() < lengthFieldSize) { encoded.resetReaderIndex(); - encoded.discardReadBytes(); return; } int nameLength = readLengthField(encoded); @@ -101,7 +100,6 @@ public class SpdyHeaderBlockRawDecoder extends SpdyHeaderBlockDecoder { // Try to read name if (encoded.readableBytes() < nameLength) { encoded.resetReaderIndex(); - encoded.discardReadBytes(); return; } byte[] nameBytes = new byte[nameLength]; @@ -117,7 +115,6 @@ public class SpdyHeaderBlockRawDecoder extends SpdyHeaderBlockDecoder { // Try to read length of value if (encoded.readableBytes() < lengthFieldSize) { encoded.resetReaderIndex(); - encoded.discardReadBytes(); return; } int valueLength = readLengthField(encoded); @@ -150,7 +147,6 @@ public class SpdyHeaderBlockRawDecoder extends SpdyHeaderBlockDecoder { // Try to read value if (encoded.readableBytes() < valueLength) { encoded.resetReaderIndex(); - encoded.discardReadBytes(); return; } byte[] valueBytes = new byte[valueLength]; diff --git a/src/main/java/org/jboss/netty/handler/codec/spdy/SpdyHeaderBlockZlibDecoder.java b/src/main/java/org/jboss/netty/handler/codec/spdy/SpdyHeaderBlockZlibDecoder.java index 8b7e8ddd25..38b4ff1f22 100644 --- a/src/main/java/org/jboss/netty/handler/codec/spdy/SpdyHeaderBlockZlibDecoder.java +++ b/src/main/java/org/jboss/netty/handler/codec/spdy/SpdyHeaderBlockZlibDecoder.java @@ -70,6 +70,7 @@ class SpdyHeaderBlockZlibDecoder extends SpdyHeaderBlockRawDecoder { if (frame != null) { decompressed.writeBytes(out, 0, numBytes); super.decode(decompressed, frame); + decompressed.discardReadBytes(); } return numBytes; } catch (DataFormatException e) {