summaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorRoman Arutyunyan <arut@nginx.com>2022-11-02 13:46:16 +0400
committerRoman Arutyunyan <arut@nginx.com>2022-11-02 13:46:16 +0400
commit7600ca028644d3ecc7e62499d71bbe21fe3bda0d (patch)
treefc51ec5440b2dbf3c3b2efd4d9341a11b588d955 /src/core
parentd7483bf1af704c1ef55e706ed3e44a09ee1e1f9b (diff)
downloadnginx-7600ca028644d3ecc7e62499d71bbe21fe3bda0d.tar.gz
nginx-7600ca028644d3ecc7e62499d71bbe21fe3bda0d.tar.bz2
Increased maximum read PROXY protocol header size.
Maximum size for reading the PROXY protocol header is increased to 4096 to accommodate a bigger number of TLVs, which are supported since cca4c8a715de. Maximum size for writing the PROXY protocol header is not changed since only version 1 is currently supported.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/ngx_proxy_protocol.c2
-rw-r--r--src/core/ngx_proxy_protocol.h3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/core/ngx_proxy_protocol.c b/src/core/ngx_proxy_protocol.c
index 2d9c095b1..212763647 100644
--- a/src/core/ngx_proxy_protocol.c
+++ b/src/core/ngx_proxy_protocol.c
@@ -281,7 +281,7 @@ ngx_proxy_protocol_write(ngx_connection_t *c, u_char *buf, u_char *last)
{
ngx_uint_t port, lport;
- if (last - buf < NGX_PROXY_PROTOCOL_MAX_HEADER) {
+ if (last - buf < NGX_PROXY_PROTOCOL_V1_MAX_HEADER) {
return NULL;
}
diff --git a/src/core/ngx_proxy_protocol.h b/src/core/ngx_proxy_protocol.h
index 7d9d3eb70..d1749f57b 100644
--- a/src/core/ngx_proxy_protocol.h
+++ b/src/core/ngx_proxy_protocol.h
@@ -13,7 +13,8 @@
#include <ngx_core.h>
-#define NGX_PROXY_PROTOCOL_MAX_HEADER 107
+#define NGX_PROXY_PROTOCOL_V1_MAX_HEADER 107
+#define NGX_PROXY_PROTOCOL_MAX_HEADER 4096
struct ngx_proxy_protocol_s {