diff options
author | 2015-05-07 07:58:38 -0700 | |
---|---|---|
committer | 2015-05-07 07:58:38 -0700 | |
commit | 63733efd730316c0317a5df4f288aac242014d91 (patch) | |
tree | 221ea78d97a590bef1bc3496eb0ff1b81d322980 /src/core/transport/chttp2_transport.c | |
parent | a568ce7245a7c79a2951cd85b040a7b4995ff875 (diff) | |
parent | 594856fe64d04911e0655a729f6ef85994c7f2d4 (diff) |
Merge pull request #1499 from jtattermusch/core_cb_fix
Fix server side call finalization when connection is closed.
Diffstat (limited to 'src/core/transport/chttp2_transport.c')
-rw-r--r-- | src/core/transport/chttp2_transport.c | 30 |
1 files changed, 16 insertions, 14 deletions
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; + } } } |