Don't send WINDOW_UPDATE if session is being closed

This commit is contained in:
Tatsuhiro Tsujikawa 2016-03-29 23:30:55 +09:00
parent 1fef49aaa4
commit 8667bbb823
1 changed files with 5 additions and 3 deletions

View File

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