SPDY: SpdyHeaderBlockDecoder should not discard input data
This commit is contained in:
parent
b3ace85773
commit
91ee0e5a56
@ -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];
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user