From 6d6b90376b0e47e120936832c18f577906cf9868 Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Wed, 11 Feb 2015 10:19:20 -0800 Subject: [PATCH 1/3] Release write buffer in FinalizeResult --- include/grpc++/impl/call.h | 3 --- src/cpp/common/call.cc | 7 ++----- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/include/grpc++/impl/call.h b/include/grpc++/impl/call.h index edc6555b0c4..139604a531b 100644 --- a/include/grpc++/impl/call.h +++ b/include/grpc++/impl/call.h @@ -73,9 +73,6 @@ class CallOpBuffer final : public CompletionQueueTag { // Convert to an array of grpc_op elements void FillOps(grpc_op *ops, size_t *nops); - // Release send buffers. - void ReleaseSendBuffer(); - // Called by completion queue just prior to returning from Next() or Pluck() void FinalizeResult(void *tag, bool *status) override; diff --git a/src/cpp/common/call.cc b/src/cpp/common/call.cc index 1aa79d46150..2ff6007f71d 100644 --- a/src/cpp/common/call.cc +++ b/src/cpp/common/call.cc @@ -144,17 +144,14 @@ void CallOpBuffer::FillOps(grpc_op *ops, size_t *nops) { } } -void CallOpBuffer::ReleaseSendBuffer() { +void CallOpBuffer::FinalizeResult(void *tag, bool *status) { + // Release send buffers if (write_buffer_) { grpc_byte_buffer_destroy(write_buffer_); write_buffer_ = nullptr; } } -void CallOpBuffer::FinalizeResult(void *tag, bool *status) { - -} - void CCallDeleter::operator()(grpc_call* c) { grpc_call_destroy(c); } From 3f631bdec4ab203c7c09f40c314732b14a480492 Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Wed, 11 Feb 2015 10:29:36 -0800 Subject: [PATCH 2/3] Remove stale call site. --- src/cpp/common/call.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/cpp/common/call.cc b/src/cpp/common/call.cc index 2ff6007f71d..8dfe583653d 100644 --- a/src/cpp/common/call.cc +++ b/src/cpp/common/call.cc @@ -161,7 +161,5 @@ Call::Call(grpc_call* call, ChannelInterface* channel, CompletionQueue* cq) void Call::PerformOps(CallOpBuffer* buffer) { channel_->PerformOpsOnCall(buffer, this); - buffer->ReleaseSendBuffer(); -} } // namespace grpc From a52ea7bd1cdcbd007fadc0650fe5d49ae9bf7d46 Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Wed, 11 Feb 2015 10:31:29 -0800 Subject: [PATCH 3/3] typo fix --- src/cpp/common/call.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cpp/common/call.cc b/src/cpp/common/call.cc index 8dfe583653d..5a6656900ed 100644 --- a/src/cpp/common/call.cc +++ b/src/cpp/common/call.cc @@ -161,5 +161,6 @@ Call::Call(grpc_call* call, ChannelInterface* channel, CompletionQueue* cq) void Call::PerformOps(CallOpBuffer* buffer) { channel_->PerformOpsOnCall(buffer, this); +} } // namespace grpc