aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Mark D. Roth <roth@google.com>2016-11-29 14:06:45 -0800
committerGravatar Mark D. Roth <roth@google.com>2016-11-29 14:06:45 -0800
commit0610434185cd528b72e5be936075cae4c4a07a8e (patch)
treeb2bc8f8194ff2d280000d5a527d9a95c543e0a20 /src/core
parent30f698f1bcb8956d49b093391997b8d01dc2524f (diff)
Always shut down endpoints before destroying them.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/ext/client_channel/http_connect_handshaker.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/ext/client_channel/http_connect_handshaker.c b/src/core/ext/client_channel/http_connect_handshaker.c
index 48990f9dac..61fec5cba9 100644
--- a/src/core/ext/client_channel/http_connect_handshaker.c
+++ b/src/core/ext/client_channel/http_connect_handshaker.c
@@ -122,6 +122,11 @@ static void on_write_done(grpc_exec_ctx* exec_ctx, void* arg,
GRPC_ERROR_REF(error); // Take ref for the handshake-done callback.
}
if (!handshaker->shutdown) {
+ // TODO(ctiller): It is currently necessary to shutdown endpoints
+ // before destroying them, even if we know that there are no
+ // pending read/write callbacks. This should be fixed, at which
+ // point this can be removed.
+ grpc_endpoint_shutdown(exec_ctx, handshaker->args->endpoint);
// Not shutting down, so the write failed. Clean up before
// invoking the callback.
cleanup_args_for_failure_locked(handshaker);
@@ -156,6 +161,11 @@ static void on_read_done(grpc_exec_ctx* exec_ctx, void* arg,
GRPC_ERROR_REF(error); // Take ref for the handshake-done callback.
}
if (!handshaker->shutdown) {
+ // TODO(ctiller): It is currently necessary to shutdown endpoints
+ // before destroying them, even if we know that there are no
+ // pending read/write callbacks. This should be fixed, at which
+ // point this can be removed.
+ grpc_endpoint_shutdown(exec_ctx, handshaker->args->endpoint);
// Not shutting down, so the write failed. Clean up before
// invoking the callback.
cleanup_args_for_failure_locked(handshaker);