aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-08-19 12:52:50 -0700
committerGravatar Craig Tiller <ctiller@google.com>2015-08-19 12:52:50 -0700
commit86d31776a8f37d719ded99986bed80b912c3a9af (patch)
tree165b7f3772822f67c08cc00dc9a51b3315a92b5d
parent128f4a9cfe34825543dab4e29c875b59af40e666 (diff)
Fix syncronous unimplemented methods
-rw-r--r--src/cpp/server/server.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/cpp/server/server.cc b/src/cpp/server/server.cc
index dfc2b303bc..29db0b41c3 100644
--- a/src/cpp/server/server.cc
+++ b/src/cpp/server/server.cc
@@ -329,6 +329,15 @@ bool Server::Start(ServerCompletionQueue** cqs, size_t num_cqs) {
grpc_server_start(server_);
if (!has_generic_service_) {
+ if (!sync_methods_->empty()) {
+ unknown_method_.reset(new RpcServiceMethod(
+ "unknown", RpcMethod::BIDI_STREAMING, new UnknownMethodHandler));
+ // Use of emplace_back with just constructor arguments is not accepted
+ // here
+ // by gcc-4.4 because it can't match the anonymous nullptr with a proper
+ // constructor implicitly. Construct the object and use push_back.
+ sync_methods_->push_back(SyncRequest(unknown_method_.get(), nullptr));
+ }
for (size_t i = 0; i < num_cqs; i++) {
new UnimplementedAsyncRequest(this, cqs[i]);
}