aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/grpc++/async_unary_call.h
diff options
context:
space:
mode:
authorGravatar Craig Tiller <craig.tiller@gmail.com>2015-06-05 10:43:43 -0700
committerGravatar Craig Tiller <craig.tiller@gmail.com>2015-06-05 10:43:43 -0700
commitbd277cb3cb7d9e39844c82e0078c24c906156add (patch)
tree2ce23fabba137db7614f6907a821f585d1c05235 /include/grpc++/async_unary_call.h
parent6ef7f31b9835ae4d58b89cc25b817f792b8792ef (diff)
Clarify serialization traits interface
Diffstat (limited to 'include/grpc++/async_unary_call.h')
-rw-r--r--include/grpc++/async_unary_call.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/include/grpc++/async_unary_call.h b/include/grpc++/async_unary_call.h
index a3c9e20213..911092b70e 100644
--- a/include/grpc++/async_unary_call.h
+++ b/include/grpc++/async_unary_call.h
@@ -64,7 +64,7 @@ class ClientAsyncResponseReader GRPC_FINAL
: context_(context), call_(channel->CreateCall(method, context, cq)) {
init_buf_.SendInitialMetadata(context->send_initial_metadata_);
// TODO(ctiller): don't assert
- GPR_ASSERT(init_buf_.SendMessage(request));
+ GPR_ASSERT(init_buf_.SendMessage(request).IsOk());
init_buf_.ClientSendClose();
call_.PerformOps(&init_buf_);
}
@@ -120,10 +120,9 @@ class ServerAsyncResponseWriter GRPC_FINAL
ctx_->sent_initial_metadata_ = true;
}
// The response is dropped if the status is not OK.
- if (status.IsOk() && !finish_buf_.SendMessage(msg)) {
+ if (status.IsOk()) {
finish_buf_.ServerSendStatus(
- ctx_->trailing_metadata_,
- Status(INVALID_ARGUMENT, "Failed to serialize message"));
+ ctx_->trailing_metadata_, finish_buf_.SendMessage(msg));
} else {
finish_buf_.ServerSendStatus(ctx_->trailing_metadata_, status);
}