aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/surface/channel.c
diff options
context:
space:
mode:
authorGravatar Muxi Yan <mxyan@google.com>2017-07-21 09:26:04 -0700
committerGravatar Muxi Yan <mxyan@google.com>2017-07-26 14:20:01 -0700
commit68a0fd54169d165060b09efadb1e2c0df4a294cb (patch)
tree82192b7622e6fc80de3559f372b158c21a182227 /src/core/lib/surface/channel.c
parentc97fc14a0ece99339f56b313b862f1a28f48c8b8 (diff)
Separate stream compression from message-wise compression
Diffstat (limited to 'src/core/lib/surface/channel.c')
-rw-r--r--src/core/lib/surface/channel.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/core/lib/surface/channel.c b/src/core/lib/surface/channel.c
index 5780a18ce8..dcb24f0307 100644
--- a/src/core/lib/surface/channel.c
+++ b/src/core/lib/surface/channel.c
@@ -149,12 +149,31 @@ grpc_channel *grpc_channel_create_with_builder(
&args->args[i],
(grpc_integer_options){GRPC_COMPRESS_NONE, GRPC_COMPRESS_NONE,
GRPC_COMPRESS_ALGORITHMS_COUNT - 1});
+ } else if (0 == strcmp(args->args[i].key,
+ GRPC_STREAM_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM)) {
+ channel->compression_options.default_stream_compression_algorithm.is_set =
+ true;
+ channel->compression_options.default_stream_compression_algorithm
+ .algorithm =
+ (grpc_stream_compression_algorithm)grpc_channel_arg_get_integer(
+ &args->args[i],
+ (grpc_integer_options){
+ GRPC_STREAM_COMPRESS_NONE, GRPC_STREAM_COMPRESS_NONE,
+ GRPC_STREAM_COMPRESS_ALGORITHMS_COUNT - 1});
} else if (0 ==
strcmp(args->args[i].key,
GRPC_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET)) {
channel->compression_options.enabled_algorithms_bitset =
(uint32_t)args->args[i].value.integer |
0x1; /* always support no compression */
+ } else if (0 ==
+ strcmp(
+ args->args[i].key,
+ GRPC_STREAM_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET)) {
+ channel->compression_options
+ .enabled_stream_compression_algorithms_bitset =
+ (uint32_t)args->args[i].value.integer |
+ 0x1; /* always support no compression */
}
}