diff options
author | Muxi Yan <mxyan@google.com> | 2017-08-17 18:44:12 -0700 |
---|---|---|
committer | Muxi Yan <mxyan@google.com> | 2017-08-17 18:44:45 -0700 |
commit | d37411e71d99f44d36260540546e3973ccb4497e (patch) | |
tree | 571a16271a55c072722f6f0e36ea8fb72273a75d | |
parent | 40787710496c02e89285f272c1ce9929e4b50436 (diff) |
Some missing parts
-rw-r--r-- | include/grpc/impl/codegen/compression_types.h | 4 | ||||
-rw-r--r-- | src/core/ext/filters/http/message_compress/message_compress_filter.c | 2 | ||||
-rw-r--r-- | src/core/lib/surface/channel.c | 10 |
3 files changed, 15 insertions, 1 deletions
diff --git a/include/grpc/impl/codegen/compression_types.h b/include/grpc/impl/codegen/compression_types.h index f2f5db060e..4419e2a447 100644 --- a/include/grpc/impl/codegen/compression_types.h +++ b/include/grpc/impl/codegen/compression_types.h @@ -50,6 +50,10 @@ extern "C" { /** Default compression level for the channel. * Its value is an int from the \a grpc_compression_level enum. */ #define GRPC_COMPRESSION_CHANNEL_DEFAULT_LEVEL "grpc.default_compression_level" +/** Default stream compression level for the channel. + * Its value is an int from the \a grpc_stream_compression_level enum. */ +#define GRPC_STREAM_COMPRESSION_CHANNEL_DEFAULT_LEVEL \ + "grpc.default_stream_compression_level" /** Compression algorithms supported by the channel. * Its value is a bitset (an int). Bits correspond to algorithms in \a * grpc_compression_algorithm. For example, its LSB corresponds to 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 19ceed6780..b96503972b 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 @@ -488,7 +488,7 @@ static grpc_error *init_channel_elem(grpc_exec_ctx *exec_ctx, grpc_channel_element_args *args) { channel_data *channeld = elem->channel_data; - /* Configuration for message-wise compression */ + /* Configuration for message compression */ channeld->enabled_algorithms_bitset = grpc_channel_args_compression_algorithm_get_states(args->channel_args); diff --git a/src/core/lib/surface/channel.c b/src/core/lib/surface/channel.c index dcb24f0307..6886e57737 100644 --- a/src/core/lib/surface/channel.c +++ b/src/core/lib/surface/channel.c @@ -142,6 +142,16 @@ grpc_channel *grpc_channel_create_with_builder( GRPC_COMPRESS_LEVEL_NONE, GRPC_COMPRESS_LEVEL_COUNT - 1}); } else if (0 == strcmp(args->args[i].key, + GRPC_STREAM_COMPRESSION_CHANNEL_DEFAULT_LEVEL)) { + channel->compression_options.default_stream_compression_level.is_set = + true; + channel->compression_options.default_stream_compression_level.level = + (grpc_compression_level)grpc_channel_arg_get_integer( + &args->args[i], + (grpc_integer_options){GRPC_COMPRESS_LEVEL_NONE, + GRPC_COMPRESS_LEVEL_NONE, + GRPC_COMPRESS_LEVEL_COUNT - 1}); + } else if (0 == strcmp(args->args[i].key, GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM)) { channel->compression_options.default_algorithm.is_set = true; channel->compression_options.default_algorithm.algorithm = |