mirror of
https://github.com/nginx/nginx.git
synced 2025-01-07 06:33:00 -06:00
downgrade gravity of getsockname() errors
This commit is contained in:
parent
37188918ed
commit
c1484ffa65
@ -348,10 +348,12 @@ ngx_http_userid_set_uid(ngx_http_request_t *r, ngx_http_userid_ctx_t *ctx,
|
||||
if (r->in_addr == 0) {
|
||||
slen = sizeof(struct sockaddr_in);
|
||||
if (getsockname(r->connection->fd,
|
||||
(struct sockaddr *) &sin, &slen) == -1)
|
||||
(struct sockaddr *) &sin, &slen)
|
||||
== -1)
|
||||
{
|
||||
ngx_log_error(NGX_LOG_CRIT, r->connection->log,
|
||||
ngx_socket_errno, "getsockname() failed");
|
||||
ngx_connection_error(r->connection, ngx_socket_errno,
|
||||
"getsockname() failed");
|
||||
return NGX_ERROR;
|
||||
}
|
||||
|
||||
r->in_addr = sin.sin_addr.s_addr;
|
||||
|
@ -749,8 +749,7 @@ ngx_http_variable_server_addr(ngx_http_request_t *r,
|
||||
if (r->in_addr == 0) {
|
||||
len = sizeof(struct sockaddr_in);
|
||||
if (getsockname(c->fd, (struct sockaddr *) &sin, &len) == -1) {
|
||||
ngx_log_error(NGX_LOG_CRIT, c->log,
|
||||
ngx_socket_errno, "getsockname() failed");
|
||||
ngx_connection_error(c, ngx_socket_errno, "getsockname() failed");
|
||||
return NGX_ERROR;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user