From 3676b38183c2d288c6daef1c0f3fd9b08f3927bc Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 6 May 2015 13:01:05 -0700 Subject: Lose redundant tag on unary calls --- include/grpc++/async_unary_call.h | 5 ++--- include/grpc++/impl/call.h | 8 ++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/grpc++/async_unary_call.h b/include/grpc++/async_unary_call.h index d1d5be5b50..3e58bf2130 100644 --- a/include/grpc++/async_unary_call.h +++ b/include/grpc++/async_unary_call.h @@ -49,9 +49,8 @@ class ClientAsyncResponseReader GRPC_FINAL { public: ClientAsyncResponseReader(ChannelInterface* channel, CompletionQueue* cq, const RpcMethod& method, ClientContext* context, - const grpc::protobuf::Message& request, void* tag) + const grpc::protobuf::Message& request) : context_(context), call_(channel->CreateCall(method, context, cq)) { - init_buf_.Reset(tag); init_buf_.AddSendInitialMetadata(&context->send_initial_metadata_); init_buf_.AddSendMessage(request); init_buf_.AddClientSendClose(); @@ -79,7 +78,7 @@ class ClientAsyncResponseReader GRPC_FINAL { private: ClientContext* context_; Call call_; - CallOpBuffer init_buf_; + SneakyCallOpBuffer init_buf_; CallOpBuffer meta_buf_; CallOpBuffer finish_buf_; }; diff --git a/include/grpc++/impl/call.h b/include/grpc++/impl/call.h index d76ef61dd2..aae199db1b 100644 --- a/include/grpc++/impl/call.h +++ b/include/grpc++/impl/call.h @@ -123,6 +123,14 @@ class CallOpBuffer : public CompletionQueueTag { bool* recv_closed_; }; +// SneakyCallOpBuffer does not post completions to the completion queue +class SneakyCallOpBuffer GRPC_FINAL : public CallOpBuffer { + public: + bool FinalizeResult(void** tag, bool* status) GRPC_OVERRIDE { + return CallOpBuffer::FinalizeResult(tag, status) && false; + } +}; + // Channel and Server implement this to allow them to hook performing ops class CallHook { public: -- cgit v1.2.3