aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2007-12-30 08:01:50 +0000
committerIgor Sysoev <igor@sysoev.ru>2007-12-30 08:01:50 +0000
commitcc5956772bb28f1ca815d2636d44469ba00e687e (patch)
tree5d3d6d89bf05ea9a93d0d0452a24f78fc786e73b /src
parent6d7f8658ed788aeb0a8ee87a9ffc6613cc001bfa (diff)
downloadnginx-cc5956772bb28f1ca815d2636d44469ba00e687e.tar.gz
nginx-cc5956772bb28f1ca815d2636d44469ba00e687e.zip
log server address
Diffstat (limited to 'src')
-rw-r--r--src/http/ngx_http.h2
-rw-r--r--src/http/ngx_http_request.c8
2 files changed, 7 insertions, 3 deletions
diff --git a/src/http/ngx_http.h b/src/http/ngx_http.h
index d6eb263dd..41b6c06b5 100644
--- a/src/http/ngx_http.h
+++ b/src/http/ngx_http.h
@@ -47,7 +47,7 @@ typedef u_char *(*ngx_http_log_handler_pt)(ngx_http_request_t *r,
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
index d4ddf4586..8a8b5ac97 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -173,7 +173,7 @@ ngx_http_init_connection(ngx_connection_t *c)
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_char *buf, size_t len)
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;