diff options
author | Craig Tiller <ctiller@google.com> | 2015-05-05 08:44:47 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-05-05 08:44:47 -0700 |
commit | 5fdcbb7fbebe6efd353494a8f316216f13f7cf13 (patch) | |
tree | 50ca95b4a61bf94954e1c1db0f138cc29b47487a /src/cpp/common/call.cc | |
parent | 8e7fe9b9f01f88e322b97bdd5ed399395e563cde (diff) | |
parent | d53d87cbd3a93fa90ac1363fd5dc3b27dbb31cae (diff) |
Merge github.com:grpc/grpc into bye-bye-completion-queue-pie
Diffstat (limited to 'src/cpp/common/call.cc')
-rw-r--r-- | src/cpp/common/call.cc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/cpp/common/call.cc b/src/cpp/common/call.cc index a60282316a..1068111e3f 100644 --- a/src/cpp/common/call.cc +++ b/src/cpp/common/call.cc @@ -55,6 +55,7 @@ CallOpBuffer::CallOpBuffer() recv_message_(nullptr), recv_message_buffer_(nullptr), recv_buf_(nullptr), + max_message_size_(-1), client_send_close_(false), recv_trailing_metadata_(nullptr), recv_status_(nullptr), @@ -311,7 +312,8 @@ bool CallOpBuffer::FinalizeResult(void** tag, bool* status) { got_message = *status; if (recv_message_) { GRPC_TIMER_BEGIN(GRPC_PTAG_PROTO_DESERIALIZE, 0); - *status = *status && DeserializeProto(recv_buf_, recv_message_); + *status = *status && + DeserializeProto(recv_buf_, recv_message_, max_message_size_); grpc_byte_buffer_destroy(recv_buf_); GRPC_TIMER_END(GRPC_PTAG_PROTO_DESERIALIZE, 0); } else { @@ -338,9 +340,19 @@ bool CallOpBuffer::FinalizeResult(void** tag, bool* status) { } Call::Call(grpc_call* call, CallHook* call_hook, CompletionQueue* cq) - : call_hook_(call_hook), cq_(cq), call_(call) {} + : call_hook_(call_hook), cq_(cq), call_(call), max_message_size_(-1) {} + +Call::Call(grpc_call* call, CallHook* call_hook, CompletionQueue* cq, + int max_message_size) + : call_hook_(call_hook), + cq_(cq), + call_(call), + max_message_size_(max_message_size) {} void Call::PerformOps(CallOpBuffer* buffer) { + if (max_message_size_ > 0) { + buffer->set_max_message_size(max_message_size_); + } call_hook_->PerformOpsOnCall(buffer, this); } |