downgrade gravity of getsockname() errors
diff --git a/src/http/modules/ngx_http_userid_filter_module.c b/src/http/modules/ngx_http_userid_filter_module.c index c341a08..b316630 100644 --- a/src/http/modules/ngx_http_userid_filter_module.c +++ b/src/http/modules/ngx_http_userid_filter_module.c
@@ -348,10 +348,12 @@ 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;
diff --git a/src/http/ngx_http_variables.c b/src/http/ngx_http_variables.c index ecf20c3..1201458 100644 --- a/src/http/ngx_http_variables.c +++ b/src/http/ngx_http_variables.c
@@ -749,8 +749,7 @@ 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; }