Welcome! Log In Create A New Profile

Advanced

[nginx] Added logging to PROXY protocol write buffer check.

Sergey Kandaurov
November 21, 2022 10:30AM
details: https://hg.nginx.org/nginx/rev/251daa98cc87
branches:
changeset: 8100:251daa98cc87
user: Maxim Dounin <mdounin@mdounin.ru>
date: Tue Nov 08 12:48:19 2022 +0300
description:
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.

diffstat:

src/core/ngx_proxy_protocol.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diffs (12 lines):

diff -r 17d6a537fb1b -r 251daa98cc87 src/core/ngx_proxy_protocol.c
--- a/src/core/ngx_proxy_protocol.c Wed Nov 02 13:46:16 2022 +0400
+++ b/src/core/ngx_proxy_protocol.c Tue Nov 08 12:48:19 2022 +0300
@@ -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;
}

_______________________________________________
nginx-devel mailing list -- nginx-devel@nginx.org
To unsubscribe send an email to nginx-devel-leave@nginx.org
Subject Author Views Posted

[nginx] Added logging to PROXY protocol write buffer check.

Sergey Kandaurov 210 November 21, 2022 10:30AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 83
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready