summaryrefslogtreecommitdiffhomepage
path: root/src/stream
diff options
context:
space:
mode:
authorRoman Arutyunyan <arut@nginx.com>2025-10-23 18:21:57 +0400
committerRoman Arutyunyan <arutyunyan.roman@gmail.com>2025-10-24 17:49:04 +0400
commit364a94ecec13037126f28f91cf8f290979ffc229 (patch)
tree77047e1fe845be4ae7e788a4f4daaab84d1d15f7 /src/stream
parent42ca3a4576a32d0a912b0bba4088b8169f55ab2d (diff)
downloadnginx-364a94ecec13037126f28f91cf8f290979ffc229.tar.gz
nginx-364a94ecec13037126f28f91cf8f290979ffc229.tar.bz2
Upstream: reset local address in case of error.
After f10bc5a763bb the address was set to NULL only when local address was not specified at all. In case complex value evaluated to an empty or invalid string, local address remained unchanged. Currenrly this is not a problem since the value is only set once. This change is a preparation for being able to change the local address after initial setting.
Diffstat (limited to 'src/stream')
-rw-r--r--src/stream/ngx_stream_proxy_module.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/stream/ngx_stream_proxy_module.c b/src/stream/ngx_stream_proxy_module.c
index 6e51585f6..300bdf681 100644
--- a/src/stream/ngx_stream_proxy_module.c
+++ b/src/stream/ngx_stream_proxy_module.c
@@ -680,6 +680,7 @@ ngx_stream_proxy_set_local(ngx_stream_session_t *s, ngx_stream_upstream_t *u,
}
if (val.len == 0) {
+ u->peer.local = NULL;
return NGX_OK;
}
@@ -696,6 +697,7 @@ ngx_stream_proxy_set_local(ngx_stream_session_t *s, ngx_stream_upstream_t *u,
if (rc != NGX_OK) {
ngx_log_error(NGX_LOG_ERR, s->connection->log, 0,
"invalid local address \"%V\"", &val);
+ u->peer.local = NULL;
return NGX_OK;
}