From 7596e7d12c6e86bd250f65708aedc982b7e6524e Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 11 Feb 2015 14:13:52 -0800 Subject: Tweak metadata sending --- src/cpp/common/call.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') 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* 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; -- cgit v1.2.3