aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cpp/common/call.cc
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-02-11 14:13:52 -0800
committerGravatar Craig Tiller <ctiller@google.com>2015-02-11 14:13:52 -0800
commit7596e7d12c6e86bd250f65708aedc982b7e6524e (patch)
tree228d0830fe41e7369890f8ca5c44924debfe16d0 /src/cpp/common/call.cc
parentdbc8d685dbcac1519def81999f78dc50dd7a8797 (diff)
Tweak metadata sending
Diffstat (limited to 'src/cpp/common/call.cc')
-rw-r--r--src/cpp/common/call.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/cpp/common/call.cc b/src/cpp/common/call.cc
index 765baa06ca..6148855337 100644
--- a/src/cpp/common/call.cc
+++ b/src/cpp/common/call.cc
@@ -142,8 +142,12 @@ void CallOpBuffer::AddClientRecvStatus(
void CallOpBuffer::AddServerSendStatus(
std::multimap<grpc::string, grpc::string>* metadata, const Status& status) {
- trailing_metadata_count_ = metadata->size();
- trailing_metadata_ = FillMetadataArray(metadata);
+ if (metadata != NULL) {
+ trailing_metadata_count_ = metadata->size();
+ trailing_metadata_ = FillMetadataArray(metadata);
+ } else {
+ trailing_metadata_count_ = 0;
+ }
send_status_ = &status;
}
@@ -163,6 +167,7 @@ void CallOpBuffer::FillOps(grpc_op *ops, size_t *nops) {
if (send_message_) {
bool success = SerializeProto(*send_message_, &send_message_buf_);
if (!success) {
+ abort();
// TODO handle parse failure
}
ops[*nops].op = GRPC_OP_SEND_MESSAGE;