aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/surface/server.c
diff options
context:
space:
mode:
authorGravatar Nicolas Noble <nicolasnoble@users.noreply.github.com>2015-05-27 10:55:12 -0700
committerGravatar Nicolas Noble <nicolasnoble@users.noreply.github.com>2015-05-27 10:55:12 -0700
commita7628c45a52c137f01bb1b6c86763ab59f2855dd (patch)
tree1bff16cf5ed60cbc40f2cb18ce6c61c5ba1e6be7 /src/core/surface/server.c
parent4479d7d10fc46967f532c4164b3f1a1364a531e1 (diff)
parent4ebeb402ae1ccd4f2d517b9d610f72d96be7b8a9 (diff)
Merge pull request #1745 from ctiller/misbehaving-is-expected
Add testing of bad client behavior
Diffstat (limited to 'src/core/surface/server.c')
-rw-r--r--src/core/surface/server.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/surface/server.c b/src/core/surface/server.c
index e99e3e2b04..a60d5f7717 100644
--- a/src/core/surface/server.c
+++ b/src/core/surface/server.c
@@ -1131,3 +1131,12 @@ static void publish_registered_or_batch(grpc_call *call, int success,
const grpc_channel_args *grpc_server_get_channel_args(grpc_server *server) {
return server->channel_args;
}
+
+int grpc_server_has_open_connections(grpc_server *server) {
+ int r;
+ gpr_mu_lock(&server->mu);
+ r = server->root_channel_data.next != &server->root_channel_data;
+ gpr_mu_unlock(&server->mu);
+ return r;
+}
+