From 99aa0f9e8f1a88def7bdebf1385678559cda0707 Mon Sep 17 00:00:00 2001 From: Feng Xiao Date: Thu, 20 Nov 2014 16:18:53 -0800 Subject: Down-integrate from internal code base. --- src/google/protobuf/descriptor.cc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/google/protobuf/descriptor.cc') diff --git a/src/google/protobuf/descriptor.cc b/src/google/protobuf/descriptor.cc index d3a60045..7bc172a8 100644 --- a/src/google/protobuf/descriptor.cc +++ b/src/google/protobuf/descriptor.cc @@ -1843,6 +1843,13 @@ void MethodDescriptor::CopyTo(MethodDescriptorProto* proto) const { if (&options() != &MethodOptions::default_instance()) { proto->mutable_options()->CopyFrom(options()); } + + if (client_streaming_) { + proto->set_client_streaming(true); + } + if (server_streaming_) { + proto->set_server_streaming(true); + } } // DebugString methods =============================================== @@ -2395,10 +2402,12 @@ void MethodDescriptor::DebugString(int depth, string *contents, comment_printer(this, prefix, debug_string_options); comment_printer.AddPreComment(contents); - strings::SubstituteAndAppend(contents, "$0rpc $1(.$2) returns (.$3)", + strings::SubstituteAndAppend(contents, "$0rpc $1($4.$2) returns ($5.$3)", prefix, name(), input_type()->full_name(), - output_type()->full_name()); + output_type()->full_name(), + client_streaming() ? "stream " : "", + server_streaming() ? "stream " : ""); string formatted_options; if (FormatLineOptions(depth, options(), &formatted_options)) { @@ -4393,6 +4402,9 @@ void DescriptorBuilder::BuildMethod(const MethodDescriptorProto& proto, AllocateOptions(proto.options(), result); } + result->client_streaming_ = proto.client_streaming(); + result->server_streaming_ = proto.server_streaming(); + AddSymbol(result->full_name(), parent, result->name(), proto, Symbol(result)); } -- cgit v1.2.3