diff options
Diffstat (limited to 'src/cpp')
-rw-r--r-- | src/cpp/common/call.cc | 6 | ||||
-rw-r--r-- | src/cpp/server/server.cc | 1 | ||||
-rw-r--r-- | src/cpp/server/server_context.cc | 7 |
3 files changed, 6 insertions, 8 deletions
diff --git a/src/cpp/common/call.cc b/src/cpp/common/call.cc index a20d4a0d9a..aae69084eb 100644 --- a/src/cpp/common/call.cc +++ b/src/cpp/common/call.cc @@ -121,6 +121,12 @@ void CallOpBuffer::AddSendInitialMetadata( initial_metadata_ = FillMetadataArray(metadata); } +void CallOpBuffer::AddRecvInitialMetadata( + std::multimap<grpc::string, grpc::string>* metadata) { + recv_initial_metadata_ = metadata; +} + + void CallOpBuffer::AddSendInitialMetadata(ClientContext *ctx) { AddSendInitialMetadata(&ctx->send_initial_metadata_); } diff --git a/src/cpp/server/server.cc b/src/cpp/server/server.cc index 938a549d4f..ea5d365154 100644 --- a/src/cpp/server/server.cc +++ b/src/cpp/server/server.cc @@ -177,7 +177,6 @@ class Server::MethodRequestData final : public CompletionQueueTag { auto status = method_->handler()->RunHandler( MethodHandler::HandlerParameter(&call_, &ctx_, req.get(), res.get())); CallOpBuffer buf; - ctx_.SendInitialMetadataIfNeeded(&buf); if (has_response_payload_) { buf.AddSendMessage(*res); } diff --git a/src/cpp/server/server_context.cc b/src/cpp/server/server_context.cc index 06eeb39297..1823dfc81b 100644 --- a/src/cpp/server/server_context.cc +++ b/src/cpp/server/server_context.cc @@ -49,11 +49,4 @@ ServerContext::ServerContext(gpr_timespec deadline, grpc_metadata *metadata, } } -void ServerContext::SendInitialMetadataIfNeeded(CallOpBuffer* buf) { - if (!sent_initial_metadata_) { - buf->AddSendInitialMetadata(&initial_metadata_); - sent_initial_metadata_ = true; - } -} - } // namespace grpc |