aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar Yang Gao <yangg@google.com>2015-05-11 11:27:02 -0700
committerGravatar Yang Gao <yangg@google.com>2015-05-11 11:27:02 -0700
commit903810191e19ef0d2bb593815b0b5277b3eb5487 (patch)
tree56ce134460bede94fc66bd3e8cc3a0d15f44224e /include
parent9b75c66860aacca212a3e43a54d50869bf779e7d (diff)
parent5f871ac2259a8ec022c1edb19e01990982fad672 (diff)
Merge pull request #1494 from ctiller/the-churnening
Lose redundant tag on unary calls
Diffstat (limited to 'include')
-rw-r--r--include/grpc++/async_unary_call.h5
-rw-r--r--include/grpc++/impl/call.h8
2 files changed, 10 insertions, 3 deletions
diff --git a/include/grpc++/async_unary_call.h b/include/grpc++/async_unary_call.h
index 97cec77955..786f8c7184 100644
--- a/include/grpc++/async_unary_call.h
+++ b/include/grpc++/async_unary_call.h
@@ -60,9 +60,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();
@@ -90,7 +89,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: