|
|
|
@ -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<Status(const void*)> serializer_; |
|
|
|
@ -383,8 +376,6 @@ class CallOpSendMessage { |
|
|
|
|
|
|
|
|
|
template <class M> |
|
|
|
|
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; |
|
|
|
|