From 8667bbb82328b61ac259010b2a2525f0beafabed Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Tue, 29 Mar 2016 23:30:55 +0900 Subject: [PATCH] Don't send WINDOW_UPDATE if session is being closed --- lib/nghttp2_session.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/nghttp2_session.c b/lib/nghttp2_session.c index 2c13b2b0..066b963e 100644 --- a/lib/nghttp2_session.c +++ b/lib/nghttp2_session.c @@ -1642,6 +1642,11 @@ static int session_predicate_push_promise_send(nghttp2_session *session, static int session_predicate_window_update_send(nghttp2_session *session, int32_t stream_id) { nghttp2_stream *stream; + + if (session_is_closing(session)) { + return NGHTTP2_ERR_SESSION_CLOSING; + } + if (stream_id == 0) { /* Connection-level window update */ return 0; @@ -1650,9 +1655,6 @@ static int session_predicate_window_update_send(nghttp2_session *session, if (stream == NULL) { return NGHTTP2_ERR_STREAM_CLOSED; } - if (session_is_closing(session)) { - return NGHTTP2_ERR_SESSION_CLOSING; - } if (stream->state == NGHTTP2_STREAM_CLOSING) { return NGHTTP2_ERR_STREAM_CLOSING; }