aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/ext/transport/chttp2/server/chttp2_server.c
diff options
context:
space:
mode:
authorGravatar Makarand Dharmapurikar <makarandd@google.com>2017-05-18 10:32:13 -0700
committerGravatar Makarand Dharmapurikar <makarandd@google.com>2017-05-18 10:32:13 -0700
commit9c156da66afde71361d07cf785a826e20ca85c9d (patch)
tree772ac2f3d1febdf4ec50748bb690ed2699e6d79d /src/core/ext/transport/chttp2/server/chttp2_server.c
parent656bbbef4152065e498ec3d5cf43bd08820da9b3 (diff)
Fixes #9542
This fixes the case when a server is shutdown right after it Accept'ed a connection. The socket needs to be closed right before the endpoint is destroyed.
Diffstat (limited to 'src/core/ext/transport/chttp2/server/chttp2_server.c')
-rw-r--r--src/core/ext/transport/chttp2/server/chttp2_server.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/core/ext/transport/chttp2/server/chttp2_server.c b/src/core/ext/transport/chttp2/server/chttp2_server.c
index b9c62c376a..2c076e821c 100644
--- a/src/core/ext/transport/chttp2/server/chttp2_server.c
+++ b/src/core/ext/transport/chttp2/server/chttp2_server.c
@@ -127,6 +127,7 @@ static void on_accept(grpc_exec_ctx *exec_ctx, void *arg, grpc_endpoint *tcp,
gpr_mu_lock(&state->mu);
if (state->shutdown) {
gpr_mu_unlock(&state->mu);
+ grpc_endpoint_shutdown(exec_ctx, tcp, GRPC_ERROR_NONE);
grpc_endpoint_destroy(exec_ctx, tcp);
gpr_free(acceptor);
return;