Some missing parts

pull/11782/head
Muxi Yan 7 years ago
parent 4078771049
commit d37411e71d
  1. 4
      include/grpc/impl/codegen/compression_types.h
  2. 2
      src/core/ext/filters/http/message_compress/message_compress_filter.c
  3. 10
      src/core/lib/surface/channel.c

@ -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

@ -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);

@ -141,6 +141,16 @@ grpc_channel *grpc_channel_create_with_builder(
(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_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;

Loading…
Cancel
Save