diff src/http/v2/ngx_http_v2.c @ 7548:99257b06b0bd

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.
author Ruslan Ermilov <ru@nginx.com>
date Tue, 13 Aug 2019 15:43:36 +0300
parents 4f4b83f00cf1
children 45415228990b
line wrap: on
line diff
--- 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_str
      */
     pool = stream->pool;
 
+    h2c->frames -= stream->frames;
+
     ngx_http_free_request(stream->request, rc);
 
     if (pool != h2c->state.pool) {