diff options
author | Yash Tibrewal <yashkt@google.com> | 2018-12-28 17:27:38 -0800 |
---|---|---|
committer | Yash Tibrewal <yashkt@google.com> | 2018-12-28 17:27:38 -0800 |
commit | 4aeba4252893755ff13b2cc0edfcc954c6d04a6b (patch) | |
tree | 6310f95aa54ec4d4b516394dbb763a0dd588e8f8 /include/grpcpp/impl/codegen/interceptor_common.h | |
parent | a76465c65cca37dbb85adc7d97c5d4af367bef0f (diff) |
Provide GetOriginalSendMessage for some APIs
Diffstat (limited to 'include/grpcpp/impl/codegen/interceptor_common.h')
-rw-r--r-- | include/grpcpp/impl/codegen/interceptor_common.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/include/grpcpp/impl/codegen/interceptor_common.h b/include/grpcpp/impl/codegen/interceptor_common.h index d0aa23cb0a..bf936368d4 100644 --- a/include/grpcpp/impl/codegen/interceptor_common.h +++ b/include/grpcpp/impl/codegen/interceptor_common.h @@ -81,6 +81,8 @@ class InterceptorBatchMethodsImpl ByteBuffer* GetSendMessage() override { return send_message_; } + const void* GetOriginalSendMessage() 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) { @@ -334,6 +339,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_; @@ -386,6 +392,14 @@ class CancelInterceptorBatchMethods return nullptr; } + const void* GetOriginalSendMessage() 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 " |