diff --git a/lib/nghttp2_session.c b/lib/nghttp2_session.c index 1b6e12fd..e7dfd19e 100644 --- a/lib/nghttp2_session.c +++ b/lib/nghttp2_session.c @@ -1336,17 +1336,7 @@ static int nghttp2_session_after_frame_sent(nghttp2_session *session) session->goaway_flags |= NGHTTP2_GOAWAY_SEND; break; case NGHTTP2_WINDOW_UPDATE: - if(frame->hd.flags & NGHTTP2_FLAG_END_FLOW_CONTROL) { - if(frame->hd.stream_id == 0) { - session->local_flow_control = 0; - } else { - nghttp2_stream *stream; - stream = nghttp2_session_get_stream(session, frame->hd.stream_id); - if(stream) { - stream->local_flow_control = 0; - } - } - } + /* nothing to do */ break; } nghttp2_active_outbound_item_reset(&session->aob); diff --git a/lib/nghttp2_submit.c b/lib/nghttp2_submit.c index 0c97f00a..34b2307b 100644 --- a/lib/nghttp2_submit.c +++ b/lib/nghttp2_submit.c @@ -234,7 +234,15 @@ int nghttp2_submit_window_update(nghttp2_session *session, uint8_t flags, nghttp2_stream *stream; flags &= NGHTTP2_FLAG_END_FLOW_CONTROL; if(flags & NGHTTP2_FLAG_END_FLOW_CONTROL) { - window_size_increment = 0; + if(stream_id == 0) { + session->local_flow_control = 0; + } else { + stream = nghttp2_session_get_stream(session, stream_id); + if(stream) { + stream->local_flow_control = 0; + } + } + return nghttp2_session_add_window_update(session, flags, stream_id, 0); } else if(window_size_increment == 0) { return NGHTTP2_ERR_INVALID_ARGUMENT; } @@ -280,7 +288,7 @@ int nghttp2_submit_window_update(nghttp2_session *session, uint8_t flags, return NGHTTP2_ERR_STREAM_CLOSED; } } - if(window_size_increment > 0 || (flags & NGHTTP2_FLAG_END_FLOW_CONTROL)) { + if(window_size_increment > 0) { return nghttp2_session_add_window_update(session, flags, stream_id, window_size_increment); }