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; }