summaryrefslogtreecommitdiff
path: root/server/log.c
diff options
context:
space:
mode:
authorGraham Leggett <minfrin@apache.org>2011-11-25 19:42:04 +0000
committerGraham Leggett <minfrin@apache.org>2011-11-25 19:42:04 +0000
commit394e5594d60f65a687e2bad9a848af8fed70a55e (patch)
tree5380b4dae1138a158b50248024aadc2280308c96 /server/log.c
parent984c3a345c2b453daec21a6ab1a7980514bd8846 (diff)
downloadhttpd-394e5594d60f65a687e2bad9a848af8fed70a55e.tar.gz
Introduce a per connection "peer_ip" and a per request "client_ip" to
distinguish between the raw IP address of the connection and the effective IP address of the request. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1206291 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/log.c')
-rw-r--r--server/log.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/server/log.c b/server/log.c
index 8e19fc1b0b..4b73a45108 100644
--- a/server/log.c
+++ b/server/log.c
@@ -562,11 +562,11 @@ static int log_remote_address(const ap_errorlog_info *info, const char *arg,
char *buf, int buflen)
{
if (info->r && !(arg && *arg == 'c'))
- return apr_snprintf(buf, buflen, "%s:%d", info->r->remote_ip,
- info->r->remote_addr->port);
+ return apr_snprintf(buf, buflen, "%s:%d", info->r->client_ip,
+ info->r->client_addr->port);
else if (info->c)
- return apr_snprintf(buf, buflen, "%s:%d", info->c->remote_ip,
- info->c->remote_addr->port);
+ return apr_snprintf(buf, buflen, "%s:%d", info->c->peer_ip,
+ info->c->peer_addr->port);
else
return 0;
}
@@ -962,18 +962,18 @@ static int do_errorlog_default(const ap_errorlog_info *info, char *buf,
}
/*
- * remote_ip can be client or backend server. If we have a scoreboard
+ * client_ip/peer_ip can be client or backend server. If we have a scoreboard
* handle, it is likely a client.
*/
if (info->r) {
len += apr_snprintf(buf + len, buflen - len,
info->r->connection->sbh ? "[client %s:%d] " : "[remote %s:%d] ",
- info->r->remote_ip, info->r->remote_addr->port);
+ info->r->client_ip, info->r->client_addr->port);
}
else if (info->c) {
len += apr_snprintf(buf + len, buflen - len,
info->c->sbh ? "[client %s:%d] " : "[remote %s:%d] ",
- info->c->remote_ip, info->c->remote_addr->port);
+ info->c->peer_ip, info->c->peer_addr->port);
}
/* the actual error message */