aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/security
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-06-03 07:54:48 -0700
committerGravatar Craig Tiller <ctiller@google.com>2015-06-03 07:54:48 -0700
commit12d7e1f306ab9104f5306e214f1b07a2c6b26192 (patch)
treeb16ea797b2d5307ff86b099c26c5470097ef34c3 /src/core/security
parent71ec6cb332328be05d993cf182cf898e44acbdfb (diff)
Dont unref secure state until destroy completes
Diffstat (limited to 'src/core/security')
-rw-r--r--src/core/security/server_secure_chttp2.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/core/security/server_secure_chttp2.c b/src/core/security/server_secure_chttp2.c
index 3519930f38..10266c8088 100644
--- a/src/core/security/server_secure_chttp2.c
+++ b/src/core/security/server_secure_chttp2.c
@@ -124,16 +124,20 @@ static void start(grpc_server *server, void *statep, grpc_pollset **pollsets,
grpc_tcp_server_start(state->tcp, pollsets, pollset_count, on_accept, state);
}
+static void destroy_done(void *statep) {
+ grpc_server_secure_state *state = statep;
+ grpc_server_listener_destroy_done(state->server);
+ state_unref(state);
+}
+
/* Server callback: destroy the tcp listener (so we don't generate further
callbacks) */
static void destroy(grpc_server *server, void *statep) {
grpc_server_secure_state *state = statep;
gpr_mu_lock(&state->mu);
state->is_shutdown = 1;
- grpc_tcp_server_destroy(state->tcp, grpc_server_listener_destroy_done,
- server);
+ grpc_tcp_server_destroy(state->tcp, destroy_done, state);
gpr_mu_unlock(&state->mu);
- state_unref(state);
}
int grpc_server_add_secure_http2_port(grpc_server *server, const char *addr,