More message compression level clean-up

reviewable/pr12708/r1
Muxi Yan 7 years ago
parent 99024d6436
commit c870ce5476
  1. 9
      src/python/grpcio/grpc/_cython/_cygrpc/grpc.pxi
  2. 6
      src/python/grpcio/grpc/_cython/_cygrpc/records.pyx.pxi
  3. 4
      test/cpp/interop/interop_server.cc

@ -545,12 +545,9 @@ cdef extern from "grpc/compression.h":
ctypedef enum grpc_compression_level:
GRPC_COMPRESS_LEVEL_NONE
GRPC_COMPRESS_LEVEL_MESSAGE_LOW
GRPC_COMPRESS_LEVEL_MESSAGE_MED
GRPC_COMPRESS_LEVEL_MESSAGE_HIGH
GRPC_COMPRESS_LEVEL_STREAM_LOW
GRPC_COMPRESS_LEVEL_STREAM_MED
GRPC_COMPRESS_LEVEL_STREAM_HIGH
GRPC_COMPRESS_LEVEL_LOW
GRPC_COMPRESS_LEVEL_MED
GRPC_COMPRESS_LEVEL_HIGH
GRPC_COMPRESS_LEVEL_COUNT
ctypedef struct grpc_compression_options:

@ -118,9 +118,9 @@ class CompressionAlgorithm:
class CompressionLevel:
none = GRPC_COMPRESS_LEVEL_NONE
low = GRPC_COMPRESS_LEVEL_MESSAGE_LOW
medium = GRPC_COMPRESS_LEVEL_MESSAGE_MED
high = GRPC_COMPRESS_LEVEL_MESSAGE_HIGH
low = GRPC_COMPRESS_LEVEL_LOW
medium = GRPC_COMPRESS_LEVEL_MED
high = GRPC_COMPRESS_LEVEL_HIGH
cdef class Timespec:

@ -163,7 +163,7 @@ class TestServiceImpl : public TestService::Service {
compression_requested ? "enabled" : "disabled", __func__);
if (compression_requested) {
// Any level would do, let's go for HIGH because we are overachievers.
context->set_compression_level(GRPC_COMPRESS_LEVEL_MESSAGE_HIGH);
context->set_compression_level(GRPC_COMPRESS_LEVEL_HIGH);
} else {
context->set_compression_level(GRPC_COMPRESS_LEVEL_NONE);
}
@ -204,7 +204,7 @@ class TestServiceImpl : public TestService::Service {
WriteOptions wopts;
if (request->response_parameters(i).has_compressed()) {
// Compress by default. Disabled on a per-message basis.
context->set_compression_level(GRPC_COMPRESS_LEVEL_MESSAGE_HIGH);
context->set_compression_level(GRPC_COMPRESS_LEVEL_HIGH);
const bool compression_requested =
request->response_parameters(i).compressed().value();
gpr_log(GPR_DEBUG, "Request for compression (%s) present for %s",

Loading…
Cancel
Save