From 5095581cdbd659c233873a23c12512e3f7d2f5bf Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 5 Jun 2015 08:03:17 -0700 Subject: [PATCH] Get server call tags right --- include/grpc++/server.h | 1 + src/cpp/server/server.cc | 2 ++ 2 files changed, 3 insertions(+) diff --git a/include/grpc++/server.h b/include/grpc++/server.h index 8c7551ccf13..cdfdc865877 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 b7508686070..eabfd866737 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; }