From c157a02ad226eb0762d77ffdc2c4f04e9356e92b Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Thu, 11 Sep 2014 17:53:48 +0000 Subject: [PATCH] mod_status should honor remote_ip as documented git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1624349 13f79535-47bb-0310-9956-ffa450edef68 --- server/scoreboard.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/server/scoreboard.c b/server/scoreboard.c index befb2bcdc2..c73db21398 100644 --- a/server/scoreboard.c +++ b/server/scoreboard.c @@ -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", -- 2.40.0