diff options
author | Yang Gao <yangg@google.com> | 2015-02-12 16:09:08 -0800 |
---|---|---|
committer | Yang Gao <yangg@google.com> | 2015-02-12 16:09:08 -0800 |
commit | cbcc977857bb81e624b5cbca3c05eb68d9797826 (patch) | |
tree | 706bd28a6ff8c7cd11703236993bf09b5f2a54b6 /src/cpp/client | |
parent | 3d20c5e8c68308b25c1cc248c613e08e1c7d7b32 (diff) |
fix sync unary call with metadata pieces
Diffstat (limited to 'src/cpp/client')
-rw-r--r-- | src/cpp/client/client_unary_call.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cpp/client/client_unary_call.cc b/src/cpp/client/client_unary_call.cc index 1221630a35..99030a2d47 100644 --- a/src/cpp/client/client_unary_call.cc +++ b/src/cpp/client/client_unary_call.cc @@ -34,6 +34,7 @@ #include <grpc++/impl/client_unary_call.h> #include <grpc++/impl/call.h> #include <grpc++/channel_interface.h> +#include <grpc++/client_context.h> #include <grpc++/completion_queue.h> #include <grpc++/status.h> #include <grpc/support/log.h> @@ -51,10 +52,11 @@ Status BlockingUnaryCall(ChannelInterface *channel, const RpcMethod &method, Status status; buf.AddSendInitialMetadata(context); buf.AddSendMessage(request); + buf.AddRecvInitialMetadata(&context->recv_initial_metadata_); bool got_message; buf.AddRecvMessage(result, &got_message); buf.AddClientSendClose(); - buf.AddClientRecvStatus(nullptr, &status); // TODO metadata + buf.AddClientRecvStatus(&context->trailing_metadata_, &status); call.PerformOps(&buf); GPR_ASSERT(cq.Pluck(&buf) && (got_message || !status.IsOk())); return status; |