diff options
author | 2016-11-07 20:06:19 -0800 | |
---|---|---|
committer | 2016-11-07 20:06:19 -0800 | |
commit | 18280299c9bfe2816983a22900e849e5985c640c (patch) | |
tree | cb14f1e5cfa0d2286bc3d552923ae6a428278cf2 /src/core/lib/surface | |
parent | 8797e94cfc2abbe8008bc72b0cef1b1add79b8a1 (diff) | |
parent | 61f0973e55c40146e11492ff7b6de39426f7e3ca (diff) |
Merge pull request #8522 from lizan/write_compressed_byte_buffer
Skip compress filter if byte_buffer is compressed
Diffstat (limited to 'src/core/lib/surface')
-rw-r--r-- | src/core/lib/surface/call.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/lib/surface/call.c b/src/core/lib/surface/call.c index 6c25952c0a..e3b088f663 100644 --- a/src/core/lib/surface/call.c +++ b/src/core/lib/surface/call.c @@ -1461,6 +1461,12 @@ static grpc_call_error call_start_batch(grpc_exec_ctx *exec_ctx, grpc_slice_buffer_stream_init( &call->sending_stream, &op->data.send_message->data.raw.slice_buffer, op->flags); + /* If the outgoing buffer is already compressed, mark it as so in the + flags. These will be picked up by the compression filter and further + (wasteful) attempts at compression skipped. */ + if (op->data.send_message->data.raw.compression > GRPC_COMPRESS_NONE) { + call->sending_stream.base.flags |= GRPC_WRITE_INTERNAL_COMPRESS; + } stream_op->send_message = &call->sending_stream.base; break; case GRPC_OP_SEND_CLOSE_FROM_CLIENT: |