From: Stefan Fritsch Date: Wed, 10 Mar 2010 13:36:10 +0000 (+0000) Subject: Improve ap_log_cerror: X-Git-Tag: 2.3.6~381 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e50806751b6340e44ec24fad6e905f53b57f8c64;p=thirdparty%2Fapache%2Fhttpd.git Improve ap_log_cerror: - Log remote port - If the connection seems to be a back-end connection, log 'remote' instead of 'client' git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@921346 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/log.c b/server/log.c index b0353d89118..9d9e24f4d5c 100644 --- a/server/log.c +++ b/server/log.c @@ -643,13 +643,18 @@ static void log_error_core(const char *file, int line, int level, } if (c) { - /* XXX: TODO: add a method of selecting whether logged client + /* XXX: TODO: add a method of selecting whether logged remote * addresses are in dotted quad or resolved form... dotted * quad is the most secure, which is why I'm implementing it * first. -djg */ + /* + * remote_ip can be client or backend server. If we have a scoreboard + * handle, it is likely a client. + */ len += apr_snprintf(errstr + len, MAX_STRING_LEN - len, - "[client %s] ", c->remote_ip); + c->sbh ? "[client %s:%d] " : "[remote %s:%d] ", + c->remote_ip, c->remote_addr->port); } if (status != 0) { if (status < APR_OS_START_EAIERR) {