]> granicus.if.org Git - apache/commitdiff
mod_status should honor remote_ip as documented
authorJim Jagielski <jim@apache.org>
Thu, 11 Sep 2014 17:53:48 +0000 (17:53 +0000)
committerJim Jagielski <jim@apache.org>
Thu, 11 Sep 2014 17:53:48 +0000 (17:53 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1624349 13f79535-47bb-0310-9956-ffa450edef68

server/scoreboard.c

index befb2bcdc2cf91dff69c9f465492842a57e69743..c73db21398a832eb524828e48d96a51339949bbc 100644 (file)
@@ -484,8 +484,14 @@ static int update_child_status_internal(int child_num,
             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",