httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r1624349 - /httpd/httpd/trunk/server/scoreboard.c
Date Thu, 11 Sep 2014 17:53:48 GMT
Author: jim
Date: Thu Sep 11 17:53:48 2014
New Revision: 1624349

URL: http://svn.apache.org/r1624349
Log:
mod_status should honor remote_ip as documented

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

Modified: httpd/httpd/trunk/server/scoreboard.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/scoreboard.c?rev=1624349&r1=1624348&r2=1624349&view=diff
==============================================================================
--- httpd/httpd/trunk/server/scoreboard.c (original)
+++ httpd/httpd/trunk/server/scoreboard.c Thu Sep 11 17:53:48 2014
@@ -484,8 +484,14 @@ static int update_child_status_internal(
             ws->last_used = apr_time_now();
         }
         if (r) {
-            apr_cpystrn(ws->client, ap_get_remote_host(c, r->per_dir_config,
-                        REMOTE_NOLOOKUP, NULL), sizeof(ws->client));
+            const char *client = ap_get_remote_host(c, r->per_dir_config,
+                                 REMOTE_NOLOOKUP, NULL);
+            if (!client || !strcmp(client, c->client_ip)) {
+                apr_cpystrn(ws->client, r->useragent_ip, sizeof(ws->client));
+            }
+            else {
+                apr_cpystrn(ws->client, client, sizeof(ws->client));
+            }
             copy_request(ws->request, sizeof(ws->request), r);
             if (r->server) {
                 apr_snprintf(ws->vhost, sizeof(ws->vhost), "%s:%d",



Mime
View raw message