comparison src/http/v3/ngx_http_v3_filter_module.c @ 8625:33578b8d453d quic

HTTP/3: fixed ngx_stat_active counter. Previously the counter was not incremented for HTTP/3 streams, but still decremented in ngx_http_close_connection(). There are two solutions here, one is to increment the counter for HTTP/3 streams, and the other one is not to decrement the counter for HTTP/3 streams. The latter solution looks inconsistent with ngx_stat_reading/ngx_stat_writing, which are incremented on a per-request basis. The change adds ngx_stat_active increment for HTTP/3 request and push streams.
author Roman Arutyunyan <arut@nginx.com>
date Wed, 22 Sep 2021 14:08:21 +0300
parents 3fdf0afd5d45
children ea9b645472b5
comparison
equal deleted inserted replaced
8624:3fdf0afd5d45 8625:33578b8d453d
894 c = ngx_http_v3_create_push_stream(pc, push_id); 894 c = ngx_http_v3_create_push_stream(pc, push_id);
895 if (c == NULL) { 895 if (c == NULL) {
896 return NGX_ABORT; 896 return NGX_ABORT;
897 } 897 }
898 898
899 #if (NGX_STAT_STUB)
900 (void) ngx_atomic_fetch_add(ngx_stat_active, 1);
901 #endif
902
899 hc = ngx_palloc(c->pool, sizeof(ngx_http_connection_t)); 903 hc = ngx_palloc(c->pool, sizeof(ngx_http_connection_t));
900 if (hc == NULL) { 904 if (hc == NULL) {
901 ngx_http_close_connection(c); 905 ngx_http_close_connection(c);
902 return NGX_ERROR; 906 return NGX_ERROR;
903 } 907 }