diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/grpcpp/impl/codegen/call_op_set.h | 3 | ||||
-rw-r--r-- | include/grpcpp/impl/codegen/client_callback.h | 8 | ||||
-rw-r--r-- | include/grpcpp/impl/codegen/interceptor.h | 9 |
3 files changed, 13 insertions, 7 deletions
diff --git a/include/grpcpp/impl/codegen/call_op_set.h b/include/grpcpp/impl/codegen/call_op_set.h index 880c62344b..c0de5ed602 100644 --- a/include/grpcpp/impl/codegen/call_op_set.h +++ b/include/grpcpp/impl/codegen/call_op_set.h @@ -400,8 +400,9 @@ Status CallOpSendMessage::SendMessage(const M& message, WriteOptions options) { }; // Serialize immediately only if we do not have access to the message pointer if (msg_ == nullptr) { - return serializer_(&message); + Status result = serializer_(&message); serializer_ = nullptr; + return result; } return Status(); } diff --git a/include/grpcpp/impl/codegen/client_callback.h b/include/grpcpp/impl/codegen/client_callback.h index c20e845810..52bcea9970 100644 --- a/include/grpcpp/impl/codegen/client_callback.h +++ b/include/grpcpp/impl/codegen/client_callback.h @@ -340,13 +340,13 @@ class ClientCallbackReaderWriterImpl context_->initial_metadata_flags()); start_corked_ = false; } - // TODO(vjpai): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessagePtr(msg).ok()); if (options.is_last_message()) { options.set_buffer_hint(); write_ops_.ClientSendClose(); } + // TODO(vjpai): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessagePtr(msg, options).ok()); callbacks_outstanding_++; if (started_) { call_.PerformOps(&write_ops_); @@ -649,13 +649,13 @@ class ClientCallbackWriterImpl context_->initial_metadata_flags()); start_corked_ = false; } - // TODO(vjpai): don't assert - GPR_CODEGEN_ASSERT(write_ops_.SendMessagePtr(msg).ok()); if (options.is_last_message()) { options.set_buffer_hint(); write_ops_.ClientSendClose(); } + // TODO(vjpai): don't assert + GPR_CODEGEN_ASSERT(write_ops_.SendMessagePtr(msg, options).ok()); callbacks_outstanding_++; if (started_) { call_.PerformOps(&write_ops_); diff --git a/include/grpcpp/impl/codegen/interceptor.h b/include/grpcpp/impl/codegen/interceptor.h index d749d8578a..5dea796a3b 100644 --- a/include/grpcpp/impl/codegen/interceptor.h +++ b/include/grpcpp/impl/codegen/interceptor.h @@ -112,12 +112,17 @@ class InterceptorBatchMethods { /// A return value of nullptr indicates that this ByteBuffer is not valid. virtual ByteBuffer* GetSerializedSendMessage() = 0; - /// Returns a non-modifiable pointer to the original non-serialized form of - /// the message. Valid for PRE_SEND_MESSAGE interceptions. A return value of + /// Returns a non-modifiable pointer to the non-serialized form of the message + /// to be sent. Valid for PRE_SEND_MESSAGE interceptions. A return value of /// nullptr indicates that this field is not valid. Also note that this is /// only supported for sync and callback APIs at the present moment. virtual const void* GetSendMessage() = 0; + /// Overwrites the message to be sent with \a message. \a message should be in + /// the non-serialized form expected by the method. Valid for PRE_SEND_MESSAGE + /// interceptions. Note that the interceptor is responsible for maintaining + /// the life of the message for the duration on the send operation, i.e., till + /// POST_SEND_MESSAGE. virtual void ModifySendMessage(const void* message) = 0; /// Checks whether the SEND MESSAGE op succeeded. Valid for POST_SEND_MESSAGE |