From 07d8304f3029f825c29399996c55119ad2bc2c82 Mon Sep 17 00:00:00 2001 From: Yang Gao Date: Fri, 13 Feb 2015 14:11:31 -0800 Subject: change stub API for server streaming, pass in const Request& instead of const Request* for the first request --- src/compiler/cpp_generator.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/compiler/cpp_generator.cc b/src/compiler/cpp_generator.cc index 2a9895e43c..60dc02d7af 100644 --- a/src/compiler/cpp_generator.cc +++ b/src/compiler/cpp_generator.cc @@ -197,10 +197,10 @@ void PrintHeaderClientMethod(google::protobuf::io::Printer *printer, printer->Print( *vars, "::grpc::ClientReader< $Response$>* $Method$(" - "::grpc::ClientContext* context, const $Request$* request);\n"); + "::grpc::ClientContext* context, const $Request$& request);\n"); printer->Print(*vars, "::grpc::ClientAsyncReader< $Response$>* $Method$(" - "::grpc::ClientContext* context, const $Request$* request, " + "::grpc::ClientContext* context, const $Request$& request, " "::grpc::CompletionQueue* cq, void* tag);\n"); } else if (BidiStreaming(method)) { printer->Print(*vars, @@ -415,25 +415,25 @@ void PrintSourceClientMethod(google::protobuf::io::Printer *printer, printer->Print( *vars, "::grpc::ClientReader< $Response$>* $Service$::Stub::$Method$(" - "::grpc::ClientContext* context, const $Request$* request) {\n"); + "::grpc::ClientContext* context, const $Request$& request) {\n"); printer->Print(*vars, " return new ::grpc::ClientReader< $Response$>(" "channel()," "::grpc::RpcMethod($Service$_method_names[$Idx$], " "::grpc::RpcMethod::RpcType::SERVER_STREAMING), " - "context, *request);\n" + "context, request);\n" "}\n\n"); printer->Print( *vars, "::grpc::ClientAsyncReader< $Response$>* $Service$::Stub::$Method$(" - "::grpc::ClientContext* context, const $Request$* request, " + "::grpc::ClientContext* context, const $Request$& request, " "::grpc::CompletionQueue* cq, void* tag) {\n"); printer->Print(*vars, " return new ::grpc::ClientAsyncReader< $Response$>(" "channel(), cq, " "::grpc::RpcMethod($Service$_method_names[$Idx$], " "::grpc::RpcMethod::RpcType::SERVER_STREAMING), " - "context, *request, tag);\n" + "context, request, tag);\n" "}\n\n"); } else if (BidiStreaming(method)) { printer->Print( -- cgit v1.2.3