diff options
author | Yash Tibrewal <yashkt@google.com> | 2019-01-04 11:30:03 -0800 |
---|---|---|
committer | Yash Tibrewal <yashkt@google.com> | 2019-01-04 11:30:03 -0800 |
commit | b05ca9697b9d28eb8fb4f3c9ad732667ed416f15 (patch) | |
tree | 71821eeee2bcac7e144844d56dd765193bde6013 /include/grpcpp/impl/codegen/interceptor_common.h | |
parent | 9b9ef640278fd5d0c9a64c1b0c7182277bc35f53 (diff) | |
parent | 2dda0bb21bbe6e0914cd12fbf3ffa013111cc8a3 (diff) |
Merge branch 'master' into failhijackedrecv
Diffstat (limited to 'include/grpcpp/impl/codegen/interceptor_common.h')
-rw-r--r-- | include/grpcpp/impl/codegen/interceptor_common.h | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/include/grpcpp/impl/codegen/interceptor_common.h b/include/grpcpp/impl/codegen/interceptor_common.h index d23b71f8a7..d60f9585fc 100644 --- a/include/grpcpp/impl/codegen/interceptor_common.h +++ b/include/grpcpp/impl/codegen/interceptor_common.h @@ -79,7 +79,9 @@ class InterceptorBatchMethodsImpl hooks_[static_cast<size_t>(type)] = true; } - ByteBuffer* GetSendMessage() override { return send_message_; } + ByteBuffer* GetSerializedSendMessage() override { return send_message_; } + + const void* GetSendMessage() override { return orig_send_message_; } std::multimap<grpc::string, grpc::string>* GetSendInitialMetadata() override { return send_initial_metadata_; @@ -115,7 +117,10 @@ class InterceptorBatchMethodsImpl return recv_trailing_metadata_->map(); } - void SetSendMessage(ByteBuffer* buf) { send_message_ = buf; } + void SetSendMessage(ByteBuffer* buf, const void* msg) { + send_message_ = buf; + orig_send_message_ = msg; + } void SetSendInitialMetadata( std::multimap<grpc::string, grpc::string>* metadata) { @@ -343,6 +348,7 @@ class InterceptorBatchMethodsImpl std::function<void(void)> callback_; ByteBuffer* send_message_ = nullptr; + const void* orig_send_message_ = nullptr; std::multimap<grpc::string, grpc::string>* send_initial_metadata_; @@ -389,13 +395,21 @@ class CancelInterceptorBatchMethods "Cancel notification"); } - ByteBuffer* GetSendMessage() override { + ByteBuffer* GetSerializedSendMessage() override { GPR_CODEGEN_ASSERT(false && "It is illegal to call GetSendMessage on a method which " "has a Cancel notification"); return nullptr; } + const void* GetSendMessage() override { + GPR_CODEGEN_ASSERT( + false && + "It is illegal to call GetOriginalSendMessage on a method which " + "has a Cancel notification"); + return nullptr; + } + std::multimap<grpc::string, grpc::string>* GetSendInitialMetadata() override { GPR_CODEGEN_ASSERT(false && "It is illegal to call GetSendInitialMetadata on a " |