aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/security
diff options
context:
space:
mode:
authorGravatar Mark D. Roth <roth@google.com>2016-12-08 09:40:33 -0800
committerGravatar Mark D. Roth <roth@google.com>2016-12-08 09:40:33 -0800
commitc898417302f4f28013e7cc21bb4476d150c962cf (patch)
treefc9b400f060ccc96bb7ddea4ed31df5484900adf /src/core/lib/security
parent7d74b666bb54674b85369f292debae29fc5d01a4 (diff)
Fix race condition on shutdown.
Diffstat (limited to 'src/core/lib/security')
-rw-r--r--src/core/lib/security/transport/security_handshaker.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/lib/security/transport/security_handshaker.c b/src/core/lib/security/transport/security_handshaker.c
index 628c747bf6..41a775db85 100644
--- a/src/core/lib/security/transport/security_handshaker.c
+++ b/src/core/lib/security/transport/security_handshaker.c
@@ -131,6 +131,9 @@ static void security_handshake_failed_locked(grpc_exec_ctx *exec_ctx,
// Not shutting down, so the write failed. Clean up before
// invoking the callback.
cleanup_args_for_failure_locked(h);
+ // Set shutdown to true so that subsequent calls to
+ // security_handshaker_shutdown() do nothing.
+ h->shutdown = true;
}
// Invoke callback.
grpc_exec_ctx_sched(exec_ctx, h->on_handshake_done, error, NULL);