]> granicus.if.org Git - apache/commitdiff
Merge r1624349 from trunk:
authorJim Jagielski <jim@apache.org>
Fri, 26 Sep 2014 10:56:39 +0000 (10:56 +0000)
committerJim Jagielski <jim@apache.org>
Fri, 26 Sep 2014 10:56:39 +0000 (10:56 +0000)
mod_status should honor remote_ip as documented

Reviewed/backported by: jim

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1627744 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
server/scoreboard.c

diff --git a/CHANGES b/CHANGES
index 4d864ac4be3bc0900a7f8489c495ef45ab7f29ea..bbb38da2ad6fb4ee858185af4081ad92ed22f9db 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
 
 Changes with Apache 2.4.11
 
+  *) mod_status: Honor client IP address using mod_remoteip. PR 55886.
+     [Jim Jagielski]
+
   *) cmake-based build for Windows: Fix incompatibility with cmake 2.8.12
      and later.  PR 56615.  [Chuck Liu <cliu81 gmail.com>, Jeff Trawick]
 
diff --git a/STATUS b/STATUS
index dcd9df4ae75a05cd3cc68c418f6716f8e2e45288..939c179f9eb057697cd68b019ce095dee0e40002 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -102,12 +102,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-   * mod_status: honor mod_remoteip.
-     trunk patch: http://svn.apache.org/r1624349
-     2.4.x patch: trunk patch works
-     +1: jim, jkaluza, mrumph
-     mrumph: This fix should be credited to bug 55886.
-
    * mod_cache: Avoid sending a 304 to an unconditional request during a 
      revalidation. PR56881
      trunk patch:  http://svn.apache.org/r1619835 
index d971e9bf1c4c3843d2ae1669c6f04618af961a2e..73bdccdd4266a70b0a10fcaf14ed24f071bc4b99 100644 (file)
@@ -484,8 +484,14 @@ static int update_child_status_internal(int child_num,
             ws->conn_bytes = 0;
         }
         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",