diff options
-rw-r--r-- | src/core/ext/filters/http/message_compress/message_compress_filter.c | 3 | ||||
-rw-r--r-- | src/core/lib/compression/compression.c | 2 | ||||
-rw-r--r-- | src/core/lib/surface/call.c | 7 | ||||
-rw-r--r-- | test/core/end2end/tests/stream_compressed_payload.c | 10 | ||||
-rw-r--r-- | test/core/end2end/tests/stream_payload.c | 10 | ||||
-rw-r--r-- | test/core/end2end/tests/stream_ping_pong_streaming.c | 10 |
6 files changed, 26 insertions, 16 deletions
diff --git a/src/core/ext/filters/http/message_compress/message_compress_filter.c b/src/core/ext/filters/http/message_compress/message_compress_filter.c index 55e92c4561..68336d60fe 100644 --- a/src/core/ext/filters/http/message_compress/message_compress_filter.c +++ b/src/core/ext/filters/http/message_compress/message_compress_filter.c @@ -118,7 +118,8 @@ static grpc_error *process_send_initial_metadata( call_data *calld = elem->call_data; channel_data *channeld = elem->channel_data; *has_compression_algorithm = false; - grpc_stream_compression_algorithm stream_compression_algorithm; + grpc_stream_compression_algorithm stream_compression_algorithm = + GRPC_STREAM_COMPRESS_NONE; if (initial_metadata->idx.named.grpc_internal_stream_encoding_request != NULL) { grpc_mdelem md = diff --git a/src/core/lib/compression/compression.c b/src/core/lib/compression/compression.c index 972ce9324b..ec84c01811 100644 --- a/src/core/lib/compression/compression.c +++ b/src/core/lib/compression/compression.c @@ -172,6 +172,8 @@ void grpc_compression_options_init(grpc_compression_options *opts) { memset(opts, 0, sizeof(*opts)); /* all enabled by default */ opts->enabled_algorithms_bitset = (1u << GRPC_COMPRESS_ALGORITHMS_COUNT) - 1; + opts->enabled_stream_compression_algorithms_bitset = + (1u << GRPC_STREAM_COMPRESS_ALGORITHMS_COUNT) - 1; } void grpc_compression_options_enable_algorithm( diff --git a/src/core/lib/surface/call.c b/src/core/lib/surface/call.c index cd797b07cf..a5311c043b 100644 --- a/src/core/lib/surface/call.c +++ b/src/core/lib/surface/call.c @@ -1613,14 +1613,15 @@ static grpc_call_error call_start_batch(grpc_exec_ctx *exec_ctx, /* process compression level */ memset(&compression_md, 0, sizeof(compression_md)); size_t additional_metadata_count = 0; - grpc_compression_level effective_compression_level = GRPC_COMPRESS_NONE; + grpc_compression_level effective_compression_level = + GRPC_COMPRESS_LEVEL_NONE; grpc_stream_compression_level effective_stream_compression_level = - GRPC_STREAM_COMPRESS_NONE; + GRPC_STREAM_COMPRESS_LEVEL_NONE; bool level_set = false; bool stream_compression = false; if (op->data.send_initial_metadata.maybe_stream_compression_level .is_set) { - effective_compression_level = + effective_stream_compression_level = op->data.send_initial_metadata.maybe_stream_compression_level .level; level_set = true; diff --git a/test/core/end2end/tests/stream_compressed_payload.c b/test/core/end2end/tests/stream_compressed_payload.c index e994ba836d..a686a566d7 100644 --- a/test/core/end2end/tests/stream_compressed_payload.c +++ b/test/core/end2end/tests/stream_compressed_payload.c @@ -560,7 +560,7 @@ static void test_invoke_request_with_compressed_payload( GRPC_STREAM_COMPRESS_GZIP, GRPC_STREAM_COMPRESS_GZIP, GRPC_STREAM_COMPRESS_GZIP, GRPC_STREAM_COMPRESS_GZIP, NULL, false, /* ignored */ - GRPC_COMPRESS_LEVEL_NONE, false, false, GRPC_COMPRESS_NONE); + GRPC_STREAM_COMPRESS_LEVEL_NONE, false, false, GRPC_COMPRESS_NONE); } static void test_invoke_request_with_send_message_before_initial_metadata( @@ -570,7 +570,7 @@ static void test_invoke_request_with_send_message_before_initial_metadata( 0, GRPC_STREAM_COMPRESS_GZIP, GRPC_STREAM_COMPRESS_GZIP, GRPC_STREAM_COMPRESS_GZIP, GRPC_STREAM_COMPRESS_GZIP, NULL, false, /* ignored */ - GRPC_COMPRESS_LEVEL_NONE, true, false, GRPC_COMPRESS_NONE); + GRPC_STREAM_COMPRESS_LEVEL_NONE, true, false, GRPC_COMPRESS_NONE); } static void test_invoke_request_with_server_level( @@ -607,7 +607,8 @@ static void test_invoke_request_with_compressed_payload_md_override( GRPC_STREAM_COMPRESS_NONE, GRPC_STREAM_COMPRESS_NONE, GRPC_STREAM_COMPRESS_GZIP, GRPC_STREAM_COMPRESS_NONE, &gzip_compression_override, false, - /*ignored*/ GRPC_COMPRESS_LEVEL_NONE, false, false, GRPC_COMPRESS_NONE); + /*ignored*/ GRPC_STREAM_COMPRESS_LEVEL_NONE, false, false, + GRPC_COMPRESS_NONE); /* Channel default stream GZIP, call override to NONE (aka IDENTITY) */ request_with_payload_template( @@ -615,7 +616,8 @@ static void test_invoke_request_with_compressed_payload_md_override( GRPC_STREAM_COMPRESS_GZIP, GRPC_STREAM_COMPRESS_NONE, GRPC_STREAM_COMPRESS_NONE, GRPC_STREAM_COMPRESS_NONE, &identity_compression_override, false, - /*ignored*/ GRPC_COMPRESS_LEVEL_NONE, false, false, GRPC_COMPRESS_NONE); + /*ignored*/ GRPC_STREAM_COMPRESS_LEVEL_NONE, false, false, + GRPC_COMPRESS_NONE); } static void test_invoke_request_with_disabled_algorithm( diff --git a/test/core/end2end/tests/stream_payload.c b/test/core/end2end/tests/stream_payload.c index 3119f88a08..ceaad02b66 100644 --- a/test/core/end2end/tests/stream_payload.c +++ b/test/core/end2end/tests/stream_payload.c @@ -265,10 +265,12 @@ static void request_response_with_payload(grpc_end2end_test_config config, payload and status. */ static void test_invoke_request_response_with_payload( grpc_end2end_test_config config) { - grpc_channel_args *client_args = grpc_channel_args_set_compression_algorithm( - NULL, GRPC_STREAM_COMPRESS_GZIP); - grpc_channel_args *server_args = grpc_channel_args_set_compression_algorithm( - NULL, GRPC_STREAM_COMPRESS_GZIP); + grpc_channel_args *client_args = + grpc_channel_args_set_stream_compression_algorithm( + NULL, GRPC_STREAM_COMPRESS_GZIP); + grpc_channel_args *server_args = + grpc_channel_args_set_stream_compression_algorithm( + NULL, GRPC_STREAM_COMPRESS_GZIP); grpc_end2end_test_fixture f = begin_test(config, "test_invoke_request_response_with_payload", client_args, server_args); diff --git a/test/core/end2end/tests/stream_ping_pong_streaming.c b/test/core/end2end/tests/stream_ping_pong_streaming.c index a3321f151b..9990091e4b 100644 --- a/test/core/end2end/tests/stream_ping_pong_streaming.c +++ b/test/core/end2end/tests/stream_ping_pong_streaming.c @@ -90,10 +90,12 @@ static void end_test(grpc_end2end_test_fixture *f) { /* Client pings and server pongs. Repeat messages rounds before finishing. */ static void test_pingpong_streaming(grpc_end2end_test_config config, int messages) { - grpc_channel_args *client_args = grpc_channel_args_set_compression_algorithm( - NULL, GRPC_STREAM_COMPRESS_GZIP); - grpc_channel_args *server_args = grpc_channel_args_set_compression_algorithm( - NULL, GRPC_STREAM_COMPRESS_GZIP); + grpc_channel_args *client_args = + grpc_channel_args_set_stream_compression_algorithm( + NULL, GRPC_STREAM_COMPRESS_GZIP); + grpc_channel_args *server_args = + grpc_channel_args_set_stream_compression_algorithm( + NULL, GRPC_STREAM_COMPRESS_GZIP); grpc_end2end_test_fixture f = begin_test(config, "test_pingpong_streaming", client_args, server_args); grpc_call *c; |