Merge pull request #946 from jpinner/spdy_fix_compression_master

SPDY: fix improper use of SYNC_FLUSH in SpdyHeaderBlockZlibCompressor
This commit is contained in:
Jeff Pinner 2013-01-16 10:48:40 -08:00
commit 5b17307b1f

View File

@ -51,8 +51,9 @@ class SpdyHeaderBlockZlibCompressor extends SpdyHeaderBlockCompressor {
@Override
public void encode(ByteBuf compressed) {
while (!compressor.needsInput()) {
int numBytes = compressor.deflate(out, 0, out.length, Deflater.SYNC_FLUSH);
int numBytes = out.length;
while (numBytes == out.length) {
numBytes = compressor.deflate(out, 0, out.length, Deflater.SYNC_FLUSH);
compressed.writeBytes(out, 0, numBytes);
}
}