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; }