mirror of https://github.com/nginx/nginx
Upstream: reset local address in case of error.
After f10bc5a763 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.
This commit is contained in:
parent
42ca3a4576
commit
364a94ecec
|
|
@ -6898,6 +6898,7 @@ ngx_http_upstream_set_local(ngx_http_request_t *r, ngx_http_upstream_t *u,
|
|||
}
|
||||
|
||||
if (val.len == 0) {
|
||||
u->peer.local = NULL;
|
||||
return NGX_OK;
|
||||
}
|
||||
|
||||
|
|
@ -6914,6 +6915,7 @@ ngx_http_upstream_set_local(ngx_http_request_t *r, ngx_http_upstream_t *u,
|
|||
if (rc != NGX_OK) {
|
||||
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
|
||||
"invalid local address \"%V\"", &val);
|
||||
u->peer.local = NULL;
|
||||
return NGX_OK;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue