Merge pull request #14286 from dgquintas/fix_compresion_alg_accessors

Fix compression algorithm accessors
pull/14308/head
Vijay Pai 7 years ago committed by GitHub
commit 73a50abd1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      include/grpc++/impl/codegen/client_context.h
  2. 5
      include/grpc++/impl/codegen/server_context.h
  3. 1
      src/cpp/client/client_context.cc
  4. 1
      src/cpp/server/server_context.cc

@ -289,7 +289,9 @@ class ClientContext {
creds_ = creds;
}
/// Return the compression algorithm to be used by the client call.
/// Return the compression algorithm the client call will request be used.
/// Note that the gRPC runtime may decide to ignore this request, for example,
/// due to resource constraints.
grpc_compression_algorithm compression_algorithm() const {
return compression_algorithm_;
}

@ -185,7 +185,10 @@ class ServerContext {
/// \a set_compression_level.
bool compression_level_set() const { return compression_level_set_; }
/// Return the compression algorithm to be used by the server call.
/// Return the compression algorithm the server call will request be used.
/// Note that the gRPC runtime may decide to ignore this request, for example,
/// due to resource constraints, or if the server is aware the client doesn't
/// support the requested algorithm.
grpc_compression_algorithm compression_algorithm() const {
return compression_algorithm_;
}

@ -96,6 +96,7 @@ void ClientContext::set_call(grpc_call* call,
void ClientContext::set_compression_algorithm(
grpc_compression_algorithm algorithm) {
compression_algorithm_ = algorithm;
const char* algorithm_name = nullptr;
if (!grpc_compression_algorithm_name(algorithm, &algorithm_name)) {
gpr_log(GPR_ERROR, "Name for compression algorithm '%d' unknown.",

@ -190,6 +190,7 @@ bool ServerContext::IsCancelled() const {
void ServerContext::set_compression_algorithm(
grpc_compression_algorithm algorithm) {
compression_algorithm_ = algorithm;
const char* algorithm_name = nullptr;
if (!grpc_compression_algorithm_name(algorithm, &algorithm_name)) {
gpr_log(GPR_ERROR, "Name for compression algorithm '%d' unknown.",

Loading…
Cancel
Save