You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by sf...@apache.org on 2010/03/10 14:36:10 UTC

svn commit: r921346 - /httpd/httpd/trunk/server/log.c

Author: sf
Date: Wed Mar 10 13:36:10 2010
New Revision: 921346

URL: http://svn.apache.org/viewvc?rev=921346&view=rev
Log:
Improve ap_log_cerror:
- Log remote port
- If the connection seems to be a back-end connection, log 'remote' instead of
  'client'

Modified:
    httpd/httpd/trunk/server/log.c

Modified: httpd/httpd/trunk/server/log.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/log.c?rev=921346&r1=921345&r2=921346&view=diff
==============================================================================
--- httpd/httpd/trunk/server/log.c (original)
+++ httpd/httpd/trunk/server/log.c Wed Mar 10 13:36:10 2010
@@ -643,13 +643,18 @@ static void log_error_core(const char *f
     }
 
     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) {