properly support global transport compression with new bytes transport request optimization

This commit is contained in:
Shay Banon 2013-12-12 22:29:54 +01:00
parent 0f4d81fcd4
commit 0469cca4be
1 changed files with 3 additions and 1 deletions

View File

@ -542,7 +542,9 @@ public class NettyTransport extends AbstractLifecycleComponent<Transport> implem
BytesStreamOutput bStream = new BytesStreamOutput();
bStream.skip(NettyHeader.HEADER_SIZE);
StreamOutput stream = bStream;
if (options.compress()) {
// only compress if asked, and, the request is not bytes, since then only
// the header part is compressed, and the "body" can't be extracted as compressed
if (options.compress() && (!(request instanceof BytesTransportRequest))) {
status = TransportStatus.setCompress(status);
stream = CompressorFactory.defaultCompressor().streamOutput(stream);
}