Mercurial > hg > nginx
comparison src/http/ngx_http_request.c @ 1810:755e09d5c271
log server address
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Sun, 30 Dec 2007 08:01:50 +0000 |
parents | bb72f7518992 |
children | 0d9c6fe7502b |
comparison
equal
deleted
inserted
replaced
1809:1f8c13eb04b6 | 1810:755e09d5c271 |
---|---|
171 if (ctx == NULL) { | 171 if (ctx == NULL) { |
172 ngx_http_close_connection(c); | 172 ngx_http_close_connection(c); |
173 return; | 173 return; |
174 } | 174 } |
175 | 175 |
176 ctx->client = &c->addr_text; | 176 ctx->connection = c; |
177 ctx->request = NULL; | 177 ctx->request = NULL; |
178 ctx->current_request = NULL; | 178 ctx->current_request = NULL; |
179 | 179 |
180 c->log->connection = c->number; | 180 c->log->connection = c->number; |
181 c->log->handler = ngx_http_log_error; | 181 c->log->handler = ngx_http_log_error; |
2582 buf = p; | 2582 buf = p; |
2583 } | 2583 } |
2584 | 2584 |
2585 ctx = log->data; | 2585 ctx = log->data; |
2586 | 2586 |
2587 p = ngx_snprintf(buf, len, ", client: %V", ctx->client); | 2587 p = ngx_snprintf(buf, len, ", client: %V", &ctx->connection->addr_text); |
2588 len -= p - buf; | 2588 len -= p - buf; |
2589 | 2589 |
2590 r = ctx->request; | 2590 r = ctx->request; |
2591 | 2591 |
2592 if (r) { | 2592 if (r) { |
2593 return r->log_handler(r, ctx->current_request, p, len); | 2593 return r->log_handler(r, ctx->current_request, p, len); |
2594 | |
2595 } else { | |
2596 p = ngx_snprintf(p, len, ", server: %V", | |
2597 &ctx->connection->listening->addr_text); | |
2594 } | 2598 } |
2595 | 2599 |
2596 return p; | 2600 return p; |
2597 } | 2601 } |
2598 | 2602 |