aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Craig Tiller <craig.tiller@gmail.com>2015-06-05 08:03:17 -0700
committerGravatar Craig Tiller <craig.tiller@gmail.com>2015-06-05 08:03:17 -0700
commit5095581cdbd659c233873a23c12512e3f7d2f5bf (patch)
tree3b9e81c8ae9f19745d61253030224d26899476b8
parente8200ba046fa5e389ea99d2fa8a627b939e646fc (diff)
Get server call tags right
-rw-r--r--include/grpc++/server.h1
-rw-r--r--src/cpp/server/server.cc2
2 files changed, 3 insertions, 0 deletions
diff --git a/include/grpc++/server.h b/include/grpc++/server.h
index 8c7551ccf1..cdfdc86587 100644
--- a/include/grpc++/server.h
+++ b/include/grpc++/server.h
@@ -114,6 +114,7 @@ class Server GRPC_FINAL : public GrpcLibrary, private CallHook {
ServerContext* const context_;
ServerAsyncStreamingInterface* const stream_;
CompletionQueue* const call_cq_;
+ void* const tag_;
grpc_call* call_;
grpc_metadata_array initial_metadata_array_;
};
diff --git a/src/cpp/server/server.cc b/src/cpp/server/server.cc
index b750868607..eabfd86673 100644
--- a/src/cpp/server/server.cc
+++ b/src/cpp/server/server.cc
@@ -427,6 +427,7 @@ Server::BaseAsyncRequest::BaseAsyncRequest(
context_(context),
stream_(stream),
call_cq_(call_cq),
+ tag_(tag),
call_(nullptr) {
memset(&initial_metadata_array_, 0, sizeof(initial_metadata_array_));
}
@@ -451,6 +452,7 @@ bool Server::BaseAsyncRequest::FinalizeResult(void** tag, bool* status) {
}
// just the pointers inside call are copied here
stream_->BindCall(&call);
+ *tag = tag_;
delete this;
return true;
}