From c2bd8a6d1a957276875ebecc72498d36daa12833 Mon Sep 17 00:00:00 2001 From: yang-g Date: Thu, 20 Aug 2015 11:40:12 -0700 Subject: [PATCH] Fix server side and generic stub --- include/grpc++/impl/rpc_method.h | 3 +++ include/grpc++/impl/rpc_service_method.h | 2 +- src/cpp/client/generic_stub.cc | 3 +-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/grpc++/impl/rpc_method.h b/include/grpc++/impl/rpc_method.h index 912ffab21f5..98002680626 100644 --- a/include/grpc++/impl/rpc_method.h +++ b/include/grpc++/impl/rpc_method.h @@ -49,6 +49,9 @@ class RpcMethod { BIDI_STREAMING }; + RpcMethod(const char* name, RpcType type) + : name_(name), method_type_(type), channel_tag_(NULL) {} + RpcMethod(const char* name, RpcType type, const std::shared_ptr& channel) : name_(name), diff --git a/include/grpc++/impl/rpc_service_method.h b/include/grpc++/impl/rpc_service_method.h index 925801e1cee..078c8c491a9 100644 --- a/include/grpc++/impl/rpc_service_method.h +++ b/include/grpc++/impl/rpc_service_method.h @@ -229,7 +229,7 @@ class RpcServiceMethod : public RpcMethod { // Takes ownership of the handler RpcServiceMethod(const char* name, RpcMethod::RpcType type, MethodHandler* handler) - : RpcMethod(name, type, nullptr), handler_(handler) {} + : RpcMethod(name, type), handler_(handler) {} MethodHandler* handler() { return handler_.get(); } diff --git a/src/cpp/client/generic_stub.cc b/src/cpp/client/generic_stub.cc index 0c90578ae52..ee89c029651 100644 --- a/src/cpp/client/generic_stub.cc +++ b/src/cpp/client/generic_stub.cc @@ -44,8 +44,7 @@ std::unique_ptr GenericStub::Call( return std::unique_ptr( new GenericClientAsyncReaderWriter( channel_.get(), cq, - RpcMethod(method.c_str(), RpcMethod::BIDI_STREAMING, nullptr), - context, tag)); + RpcMethod(method.c_str(), RpcMethod::BIDI_STREAMING), context, tag)); } } // namespace grpc