From: Jim Jagielski Date: Thu, 11 Sep 2014 17:53:48 +0000 (+0000) Subject: mod_status should honor remote_ip as documented X-Git-Tag: 2.5.0-alpha~3844 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c157a02ad226eb0762d77ffdc2c4f04e9356e92b;p=apache 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 --- 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",