# HG changeset patch # User Igor Sysoev # Date 1199001710 0 # Node ID 755e09d5c2711ef125feb675364e70ceba0ec752 # Parent 1f8c13eb04b6a24c0d197d259a3a528b93959470 log server address diff --git a/src/http/ngx_http.h b/src/http/ngx_http.h --- a/src/http/ngx_http.h +++ b/src/http/ngx_http.h @@ -47,7 +47,7 @@ typedef u_char *(*ngx_http_log_handler_p struct ngx_http_log_ctx_s { - ngx_str_t *client; + ngx_connection_t *connection; ngx_http_request_t *request; ngx_http_request_t *current_request; }; diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -173,7 +173,7 @@ ngx_http_init_connection(ngx_connection_ return; } - ctx->client = &c->addr_text; + ctx->connection = c; ctx->request = NULL; ctx->current_request = NULL; @@ -2584,13 +2584,17 @@ ngx_http_log_error(ngx_log_t *log, u_cha ctx = log->data; - p = ngx_snprintf(buf, len, ", client: %V", ctx->client); + p = ngx_snprintf(buf, len, ", client: %V", &ctx->connection->addr_text); len -= p - buf; r = ctx->request; if (r) { return r->log_handler(r, ctx->current_request, p, len); + + } else { + p = ngx_snprintf(p, len, ", server: %V", + &ctx->connection->listening->addr_text); } return p;