Fix bug with generating grpc c++ code for proto files

containing multiple services.

Hit this experimenting with using grpc to talk to pubsub.
	Change on 2014/12/15 by samuelw <samuelw@google.com>
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=82175646
pull/1/merge
samuelw 10 years ago committed by Michael Lumish
parent 31a829c165
commit ca9f359b75
  1. 4
      src/compiler/cpp_generator.cc

@ -240,7 +240,7 @@ string GetHeaderServices(const google::protobuf::FileDescriptor* file) {
map<string, string> vars; map<string, string> vars;
for (int i = 0; i < file->service_count(); ++i) { for (int i = 0; i < file->service_count(); ++i) {
PrintHeaderService(&printer, file->service(0), &vars); PrintHeaderService(&printer, file->service(i), &vars);
printer.Print("\n"); printer.Print("\n");
} }
return output; return output;
@ -442,7 +442,7 @@ string GetSourceServices(const google::protobuf::FileDescriptor* file) {
map<string, string> vars; map<string, string> vars;
for (int i = 0; i < file->service_count(); ++i) { for (int i = 0; i < file->service_count(); ++i) {
PrintSourceService(&printer, file->service(0), &vars); PrintSourceService(&printer, file->service(i), &vars);
printer.Print("\n"); printer.Print("\n");
} }
return output; return output;

Loading…
Cancel
Save