From 594856fe64d04911e0655a729f6ef85994c7f2d4 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 6 May 2015 14:09:44 -0700 Subject: Fix: Server side call with both streams closed doesnt get properly finalized --- src/core/transport/chttp2_transport.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'src/core') diff --git a/src/core/transport/chttp2_transport.c b/src/core/transport/chttp2_transport.c index dae1b1e1b7..885838ec5d 100644 --- a/src/core/transport/chttp2_transport.c +++ b/src/core/transport/chttp2_transport.c @@ -823,24 +823,26 @@ static void unlock(transport *t) { finish_reads(t); /* gather any callbacks that need to be made */ - if (!t->calling_back && cb) { + if (!t->calling_back) { perform_callbacks = prepare_callbacks(t); if (perform_callbacks) { t->calling_back = 1; } - if (t->error_state == ERROR_STATE_SEEN && !t->writing) { - call_closed = 1; - t->calling_back = 1; - t->cb = NULL; /* no more callbacks */ - t->error_state = ERROR_STATE_NOTIFIED; - } - if (t->num_pending_goaways) { - goaways = t->pending_goaways; - num_goaways = t->num_pending_goaways; - t->pending_goaways = NULL; - t->num_pending_goaways = 0; - t->cap_pending_goaways = 0; - t->calling_back = 1; + if (cb) { + if (t->error_state == ERROR_STATE_SEEN && !t->writing && !t->calling_back) { + call_closed = 1; + t->calling_back = 1; + t->cb = NULL; /* no more callbacks */ + t->error_state = ERROR_STATE_NOTIFIED; + } + if (t->num_pending_goaways) { + goaways = t->pending_goaways; + num_goaways = t->num_pending_goaways; + t->pending_goaways = NULL; + t->num_pending_goaways = 0; + t->cap_pending_goaways = 0; + t->calling_back = 1; + } } } -- cgit v1.2.3