log server address
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index d4ddf45..8a8b5ac 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -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;