aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/channel/compress_filter.c
diff options
context:
space:
mode:
authorGravatar David Garcia Quintas <dgq@google.com>2017-01-31 16:00:49 -0800
committerGravatar David Garcia Quintas <dgq@google.com>2017-01-31 16:00:49 -0800
commit7240b54ddb1a10fc4400c81bede0ac0390aa6e0f (patch)
tree8d00b26146c012ca02a812d325036130b5a67b37 /src/core/lib/channel/compress_filter.c
parent08a215f72c23525cad6a096e65175d9e11e5e8e9 (diff)
make grpc-encoding:identity implicit
Diffstat (limited to 'src/core/lib/channel/compress_filter.c')
-rw-r--r--src/core/lib/channel/compress_filter.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/core/lib/channel/compress_filter.c b/src/core/lib/channel/compress_filter.c
index c860d60d88..22781c7839 100644
--- a/src/core/lib/channel/compress_filter.c
+++ b/src/core/lib/channel/compress_filter.c
@@ -105,7 +105,6 @@ static grpc_error *process_send_initial_metadata(
static grpc_error *process_send_initial_metadata(
grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
grpc_metadata_batch *initial_metadata) {
- grpc_error *error;
call_data *calld = elem->call_data;
channel_data *channeld = elem->channel_data;
/* Parse incoming request for compression. If any, it'll be available
@@ -144,10 +143,13 @@ static grpc_error *process_send_initial_metadata(
calld->has_compression_algorithm = 1; /* GPR_TRUE */
}
+ grpc_error *error = GRPC_ERROR_NONE;
/* hint compression algorithm */
- error = grpc_metadata_batch_add_tail(
- exec_ctx, initial_metadata, &calld->compression_algorithm_storage,
- grpc_compression_encoding_mdelem(calld->compression_algorithm));
+ if (calld->compression_algorithm != GRPC_COMPRESS_NONE) {
+ error = grpc_metadata_batch_add_tail(
+ exec_ctx, initial_metadata, &calld->compression_algorithm_storage,
+ grpc_compression_encoding_mdelem(calld->compression_algorithm));
+ }
if (error != GRPC_ERROR_NONE) return error;