summaryrefslogtreecommitdiffhomepage
path: root/src/http/v2/ngx_http_v2.h
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2019-09-18 20:28:12 +0300
committerMaxim Dounin <mdounin@mdounin.ru>2019-09-18 20:28:12 +0300
commitaf0e284b967d0ecff1abcdce6558ed4635e3e757 (patch)
treec6690024177ef212f67f375e0fbd60cdbb09010f /src/http/v2/ngx_http_v2.h
parent4d4201fafd46bb97c29a9c86733331d8e7479f54 (diff)
downloadnginx-af0e284b967d0ecff1abcdce6558ed4635e3e757.tar.gz
nginx-af0e284b967d0ecff1abcdce6558ed4635e3e757.tar.bz2
HTTP/2: traffic-based flood detection.
With this patch, all traffic over an HTTP/2 connection is counted in the h2c->total_bytes field, and payload traffic is counted in the h2c->payload_bytes field. As long as total traffic is many times larger than payload traffic, we consider this to be a flood.
Diffstat (limited to 'src/http/v2/ngx_http_v2.h')
-rw-r--r--src/http/v2/ngx_http_v2.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/http/v2/ngx_http_v2.h b/src/http/v2/ngx_http_v2.h
index 69d55d1cb..59ddf54e2 100644
--- a/src/http/v2/ngx_http_v2.h
+++ b/src/http/v2/ngx_http_v2.h
@@ -119,6 +119,9 @@ struct ngx_http_v2_connection_s {
ngx_connection_t *connection;
ngx_http_connection_t *http_connection;
+ off_t total_bytes;
+ off_t payload_bytes;
+
ngx_uint_t processing;
ngx_uint_t frames;
ngx_uint_t idle;