diff --git a/include/grpcpp/impl/codegen/byte_buffer.h b/include/grpcpp/impl/codegen/byte_buffer.h index 817414c9f55..54886ae8086 100644 --- a/include/grpcpp/impl/codegen/byte_buffer.h +++ b/include/grpcpp/impl/codegen/byte_buffer.h @@ -63,16 +63,13 @@ class DeserializeFuncType; class GrpcByteBufferPeer; } // namespace internal -/// A sequence of bytes. A ByteBuffer must be backed by at least one slice to be -/// considered valid. You can consstruct an empty buffer through creating a -/// ByteBuffer backed by one empty slice. +/// A sequence of bytes. class ByteBuffer final { public: - /// Construct an uninitialized buffer. + /// Constuct an empty buffer. ByteBuffer() : buffer_(nullptr) {} - /// Construct buffer from \a slices, of which there are \a nslices. \a slices - /// must be a valid pointer. + /// Construct buffer from \a slices, of which there are \a nslices. ByteBuffer(const Slice* slices, size_t nslices) { // The following assertions check that the representation of a grpc::Slice // is identical to that of a grpc_slice: it has a grpc_slice field, and diff --git a/include/grpcpp/impl/codegen/call_op_set.h b/include/grpcpp/impl/codegen/call_op_set.h index 40a400b69d6..e6d7b900ca1 100644 --- a/include/grpcpp/impl/codegen/call_op_set.h +++ b/include/grpcpp/impl/codegen/call_op_set.h @@ -310,12 +310,7 @@ class CallOpSendMessage { protected: void AddOp(grpc_op* ops, size_t* nops) { - if (msg_ == nullptr && !send_buf_.Valid()) { - // If SendMessage was called, this is an API misuse, since we're - // attempting to send an invalid message. - GPR_CODEGEN_DEBUG_ASSERT(!send_message_called_); - return; - } + if (msg_ == nullptr && !send_buf_.Valid()) return; if (hijacked_) { serializer_ = nullptr; return; @@ -334,7 +329,6 @@ class CallOpSendMessage { } void FinishOp(bool* status) { if (msg_ == nullptr && !send_buf_.Valid()) return; - send_message_called_ = false; if (hijacked_ && failed_send_) { // Hijacking interceptor failed this Op *status = false; @@ -375,7 +369,6 @@ class CallOpSendMessage { const void* msg_ = nullptr; // The original non-serialized message bool hijacked_ = false; bool failed_send_ = false; - bool send_message_called_ = false; ByteBuffer send_buf_; WriteOptions write_options_; std::function serializer_; @@ -383,8 +376,6 @@ class CallOpSendMessage { template Status CallOpSendMessage::SendMessage(const M& message, WriteOptions options) { - GPR_CODEGEN_DEBUG_ASSERT(!send_message_called_); - send_message_called_ = true; write_options_ = options; serializer_ = [this](const void* message) { bool own_buf;