changeset 8100:251daa98cc87

Added logging to PROXY protocol write buffer check. The check is not expected to fail unless there is a bug in the calling code. But given the check is here, it should log an alert if it fails instead of silently closing the connection.
author Maxim Dounin <mdounin@mdounin.ru>
date Tue, 08 Nov 2022 12:48:19 +0300
parents 17d6a537fb1b
children 42bc158a47ec
files src/core/ngx_proxy_protocol.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/core/ngx_proxy_protocol.c
+++ b/src/core/ngx_proxy_protocol.c
@@ -282,6 +282,8 @@ ngx_proxy_protocol_write(ngx_connection_
     ngx_uint_t  port, lport;
 
     if (last - buf < NGX_PROXY_PROTOCOL_V1_MAX_HEADER) {
+        ngx_log_error(NGX_LOG_ALERT, c->log, 0,
+                      "too small buffer for PROXY protocol");
         return NULL;
     }