aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/grpc++/impl
diff options
context:
space:
mode:
authorGravatar Muxi Yan <mxyan@google.com>2017-07-27 11:16:49 -0700
committerGravatar Muxi Yan <mxyan@google.com>2017-07-27 11:16:49 -0700
commitc80526d1227c6841652f611c9562bbebf047a717 (patch)
treefb268956e463c6debbc4f5a1d3c8ad2c4f295b48 /include/grpc++/impl
parenteaa06ca708d6e6993daac10294a0bda8266bf9b3 (diff)
Modify C++ and Objective C to initialize maybe_stream_compression_level
Diffstat (limited to 'include/grpc++/impl')
-rw-r--r--include/grpc++/impl/codegen/call.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/grpc++/impl/codegen/call.h b/include/grpc++/impl/codegen/call.h
index f6eefb9f7f..4ae0127c52 100644
--- a/include/grpc++/impl/codegen/call.h
+++ b/include/grpc++/impl/codegen/call.h
@@ -204,12 +204,14 @@ class CallOpSendInitialMetadata {
public:
CallOpSendInitialMetadata() : send_(false) {
maybe_compression_level_.is_set = false;
+ maybe_stream_compression_level_.is_set = false;
}
void SendInitialMetadata(
const std::multimap<grpc::string, grpc::string>& metadata,
uint32_t flags) {
maybe_compression_level_.is_set = false;
+ maybe_stream_compression_level_.is_set = false;
send_ = true;
flags_ = flags;
initial_metadata_ =
@@ -221,6 +223,11 @@ class CallOpSendInitialMetadata {
maybe_compression_level_.level = level;
}
+ void set_stream_compression_level(grpc_stream_compression_level level) {
+ maybe_stream_compression_level_.is_set = true;
+ maybe_stream_compression_level_.level = level;
+ }
+
protected:
void AddOp(grpc_op* ops, size_t* nops) {
if (!send_) return;
@@ -236,6 +243,12 @@ class CallOpSendInitialMetadata {
op->data.send_initial_metadata.maybe_compression_level.level =
maybe_compression_level_.level;
}
+ op->data.send_initial_metadata.maybe_stream_compression_level.is_set =
+ maybe_stream_compression_level_.is_set;
+ if (maybe_stream_compression_level_.is_set) {
+ op->data.send_initial_metadata.maybe_stream_compression_level.level =
+ maybe_stream_compression_level_.level;
+ }
}
void FinishOp(bool* status) {
if (!send_) return;
@@ -251,6 +264,10 @@ class CallOpSendInitialMetadata {
bool is_set;
grpc_compression_level level;
} maybe_compression_level_;
+ struct {
+ bool is_set;
+ grpc_stream_compression_level level;
+ } maybe_stream_compression_level_;
};
class CallOpSendMessage {