diff options
author | Craig Tiller <ctiller@google.com> | 2015-02-11 14:13:52 -0800 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-02-11 14:13:52 -0800 |
commit | 7596e7d12c6e86bd250f65708aedc982b7e6524e (patch) | |
tree | 228d0830fe41e7369890f8ca5c44924debfe16d0 /src | |
parent | dbc8d685dbcac1519def81999f78dc50dd7a8797 (diff) |
Tweak metadata sending
Diffstat (limited to 'src')
-rw-r--r-- | src/cpp/common/call.cc | 9 |
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; |