aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/surface/server.c
diff options
context:
space:
mode:
authorGravatar Craig Tiller <craig.tiller@gmail.com>2015-05-26 06:28:10 -0700
committerGravatar Craig Tiller <craig.tiller@gmail.com>2015-05-26 06:28:10 -0700
commitba3c3cd36c06c88b5663d61f44accb9b5d88d77c (patch)
treea3d97ea5e60586d207ea1cd1277dcaec03bf4b96 /src/core/surface/server.c
parent18c26922d10e00b69317793dc3b72b48d0b202d9 (diff)
Add testing of bad client behavior
This test will become a suite over coming weeks. Spin up a server, and send some illegal data to it, and probe that the correct behavior occurs.
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 24a23ae5c4..6ed292b10a 100644
--- a/src/core/surface/server.c
+++ b/src/core/surface/server.c
@@ -1128,3 +1128,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;
+}
+