You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by wr...@apache.org on 2016/02/12 02:19:49 UTC
svn commit: r1729931 - /httpd/httpd/trunk/server/scoreboard.c
Author: wrowe
Date: Fri Feb 12 01:19:49 2016
New Revision: 1729931
URL: http://svn.apache.org/viewvc?rev=1729931&view=rev
Log:
A rather ugly patch since the code was refactored recently to exclude
the simple patch for 2.4.x, illustrated below.
Completes the changeset r1729930 and resolves all 2.4.19-dev corrections,
but other 2.5.0-dev specific changes may still be needed on trunk.
--- server/scoreboard.c (revision 1729907)
+++ server/scoreboard.c (working copy)
@@ -491,9 +491,8 @@
ws->conn_bytes = 0;
}
if (r) {
- const char *client = ap_get_remote_host(c, r->per_dir_config,
- REMOTE_NOLOOKUP, NULL);
- if (!client || !strcmp(client, c->client_ip)) {
+ const char *client;
+ if (!(client = ap_get_useragent_host(r, REMOTE_NOLOOKUP, NULL))) {
apr_cpystrn(ws->client, r->useragent_ip, sizeof(ws->client));
}
else {
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=1729931&r1=1729930&r2=1729931&view=diff
==============================================================================
--- httpd/httpd/trunk/server/scoreboard.c (original)
+++ httpd/httpd/trunk/server/scoreboard.c Fri Feb 12 01:19:49 2016
@@ -510,15 +510,18 @@ static int update_child_status_internal(
else if (r) {
copy_request(ws->request, sizeof(ws->request), r);
}
- if (r || c) {
- val = ap_get_remote_host(c, r? r->per_dir_config : NULL,
- REMOTE_NOLOOKUP, NULL);
- if (r && (!val || !strcmp(val, c->client_ip))) {
+ if (r) {
+ if (!(val = ap_get_useragent_host(r, REMOTE_NOLOOKUP, NULL)))
apr_cpystrn(ws->client, r->useragent_ip, sizeof(ws->client));
- }
- else {
+ else
+ apr_cpystrn(ws->client, val, sizeof(ws->client));
+ }
+ else if (c) {
+ if (!(val = ap_get_remote_host(c, c->base_server->lookup_defaults,
+ REMOTE_NOLOOKUP, NULL)))
+ apr_cpystrn(ws->client, c->client_ip, sizeof(ws->client));
+ else
apr_cpystrn(ws->client, val, sizeof(ws->client));
- }
}
if (s) {
if (c) {