From a987f81dd19210bc30b62591db331e31d3d74089 Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Tue, 13 Aug 2019 15:43:36 +0300 Subject: HTTP/2: limited number of DATA frames. Fixed excessive memory growth and CPU usage if stream windows are manipulated in a way that results in generating many small DATA frames. Fix is to limit the number of simultaneously allocated DATA frames. --- src/http/v2/ngx_http_v2.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/http/v2/ngx_http_v2.c') diff --git a/src/http/v2/ngx_http_v2.c b/src/http/v2/ngx_http_v2.c index 72d5aa508..88e2bb9fb 100644 --- a/src/http/v2/ngx_http_v2.c +++ b/src/http/v2/ngx_http_v2.c @@ -4369,6 +4369,8 @@ ngx_http_v2_close_stream(ngx_http_v2_stream_t *stream, ngx_int_t rc) */ pool = stream->pool; + h2c->frames -= stream->frames; + ngx_http_free_request(stream->request, rc); if (pool != h2c->state.pool) { -- cgit