return ngx_http_v2_state_complete(h2c, pos, end);
}
- if (window > NGX_HTTP_V2_MAX_WINDOW - h2c->send_window) {
+ if (window > NGX_HTTP_V2_MAX_WINDOW - h2c->send_window - h2c->send_queued) {
ngx_log_error(NGX_LOG_INFO, h2c->connection->log, 0,
"client violated connection flow control: "
"received WINDOW_UPDATE frame "
"with window increment %uz "
"not allowed for window %uz",
- window, h2c->send_window);
+ window, h2c->send_window + h2c->send_queued);
return ngx_http_v2_connection_error(h2c, NGX_HTTP_V2_FLOW_CTRL_ERROR);
}
ngx_http_v2_queue_frame(fn, frame);
h2c->send_window -= frame_size;
+ h2c->send_queued += frame_size;
stream->send_window -= frame_size;
stream->queued++;
stream->request->header_size += NGX_HTTP_V2_FRAME_HEADER_SIZE;
h2c->payload_bytes += frame->length;
+ h2c->send_queued -= frame->length;
ngx_http_v2_handle_frame(stream, frame);
}
h2c->send_window += window;
+ h2c->send_queued -= window;
}