aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/descriptor.cc
diff options
context:
space:
mode:
authorGravatar Feng Xiao <xfxyjwf@gmail.com>2014-11-20 16:18:53 -0800
committerGravatar Feng Xiao <xfxyjwf@gmail.com>2014-11-20 16:18:53 -0800
commit99aa0f9e8f1a88def7bdebf1385678559cda0707 (patch)
tree7ccb663ee9a1c722bf6062435ac705e83568c7e8 /src/google/protobuf/descriptor.cc
parent49bc8c09636ae61f9c685d121278c3738b9a809a (diff)
Down-integrate from internal code base.
Diffstat (limited to 'src/google/protobuf/descriptor.cc')
-rw-r--r--src/google/protobuf/descriptor.cc16
1 files changed, 14 insertions, 2 deletions
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));
}