diff options
Diffstat (limited to 'include/grpc++')
-rw-r--r-- | include/grpc++/stream.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/grpc++/stream.h b/include/grpc++/stream.h index 4a804c7c90..a59ccd8c05 100644 --- a/include/grpc++/stream.h +++ b/include/grpc++/stream.h @@ -91,6 +91,7 @@ class ClientReader final : public ClientStreamingInterface, const google::protobuf::Message &request) : context_(context), call_(channel->CreateCall(method, context, &cq_)) { CallOpBuffer buf; + buf.AddSendInitialMetadata(&context->send_initial_metadata_); buf.AddSendMessage(request); buf.AddClientSendClose(); call_.PerformOps(&buf); @@ -178,7 +179,12 @@ class ClientReaderWriter final : public ClientStreamingInterface, // Blocking create a stream. ClientReaderWriter(ChannelInterface *channel, const RpcMethod &method, ClientContext *context) - : context_(context), call_(channel->CreateCall(method, context, &cq_)) {} + : context_(context), call_(channel->CreateCall(method, context, &cq_)) { + CallOpBuffer buf; + buf.AddSendInitialMetadata(&context->send_initial_metadata_); + call_.PerformOps(&buf); + GPR_ASSERT(cq_.Pluck(&buf)); + } virtual bool Read(R *msg) override { CallOpBuffer buf; |