Mercurial > hg > nginx
changeset 1810:755e09d5c271
log server address
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Sun, 30 Dec 2007 08:01:50 +0000 |
parents | 1f8c13eb04b6 |
children | 0d9c6fe7502b |
files | src/http/ngx_http.h src/http/ngx_http_request.c |
diffstat | 2 files changed, 7 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/http/ngx_http.h Sat Dec 29 21:43:49 2007 +0000 +++ b/src/http/ngx_http.h Sun Dec 30 08:01:50 2007 +0000 @@ -47,7 +47,7 @@ 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; };
--- a/src/http/ngx_http_request.c Sat Dec 29 21:43:49 2007 +0000 +++ b/src/http/ngx_http_request.c Sun Dec 30 08:01:50 2007 +0000 @@ -173,7 +173,7 @@ return; } - ctx->client = &c->addr_text; + ctx->connection = c; ctx->request = NULL; ctx->current_request = NULL; @@ -2584,13 +2584,17 @@ 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;