diff options
author | Craig Tiller <ctiller@google.com> | 2015-09-01 15:15:42 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-09-01 15:15:42 -0700 |
commit | ae96a504dfac822bb14a2968448d62abdbb03cae (patch) | |
tree | 2bd7c61c5befa411de99489b784c400024e34824 | |
parent | 2594fb7261b6b8daba3d3c77eee122bc8c6b66cf (diff) |
Fix asan bug
-rw-r--r-- | src/core/transport/chttp2_transport.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/transport/chttp2_transport.c b/src/core/transport/chttp2_transport.c index b8705cc49b..386ba04b9c 100644 --- a/src/core/transport/chttp2_transport.c +++ b/src/core/transport/chttp2_transport.c @@ -338,10 +338,10 @@ static void destroy_transport(grpc_transport *gt) { UNREF_TRANSPORT(t, "destroy"); } -/** block grpc_endpoint_shutdown being called until a paired +/** block grpc_endpoint_shutdown being called until a paired allow_endpoint_shutdown is made */ static void prevent_endpoint_shutdown(grpc_chttp2_transport *t) { - GPR_ASSERT(t->shutdown_ep_refs.count); + GPR_ASSERT(t->ep); gpr_ref(&t->shutdown_ep_refs); } @@ -525,6 +525,8 @@ void grpc_chttp2_terminate_writing(void *transport_writing_ptr, int success) { grpc_chttp2_transport_writing *transport_writing = transport_writing_ptr; grpc_chttp2_transport *t = TRANSPORT_FROM_WRITING(transport_writing); + allow_endpoint_shutdown(t); + lock(t); if (!success) { @@ -552,7 +554,6 @@ void grpc_chttp2_terminate_writing(void *transport_writing_ptr, int success) { static void writing_action(void *gt, int iomgr_success_ignored) { grpc_chttp2_transport *t = gt; grpc_chttp2_perform_writes(&t->writing, t->ep); - allow_endpoint_shutdown(t); } void grpc_chttp2_add_incoming_goaway( |