Support %{c}h for conn-hostname, %h for useragent_host
Submitted by: wrowe
Reviewed by: jim, ylavic, covener
Merge r1818321 from trunk:
"{c}h" exists and logs the value returned by 'ap_get_useragent_host()'.
I'm not sure of the description to write there, so I just mention it in the doc and hope s.o. will find the words :)
This has been introduced in r1730129.
Submitted by: jailletc36
Reviewed by: jim, ylavic, covener
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@
1855818 13f79535-47bb-0310-9956-
ffa450edef68
-*- coding: utf-8 -*-
Changes with Apache 2.4.39
+ *) mod_log_config: Support %{c}h for conn-hostname, %h for useragent_host
+ PR 55348
+
+ *) mod_socache_redis: Support for Redis as socache storage provider.
+
*) core: new configuration option 'MergeSlashes on|off' that controls handling of
multiple, consecutive slash ('/') characters in the path component of the request URL.
[Eric Covener]
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]
- *) mod_log_config: Support %{c}h for conn-hostname, %h for useragent_host
- PR 55348
- trunk patch: https://svn.apache.org/r1730129
- 2.4.x patch: svn merge -c 1730129 ^/httpd/httpd/trunk .
- +1: jim, ylavic, covener
- jailletc36: require r1818321 and part of r1818341 to update doc accordingly
PATCHES PROPOSED TO BACKPORT FROM TRUNK:
[ New proposals should be added at the end of the list ]
href="mod_authz_host.html#reqhost">the Require host
documentation</a>.</td></tr>
+ <tr><td><code>%{c}h</code></td>
+ <td>Like <code>%h</code>, but always reports on the hostname of the
+ underlying TCP connection and not any modifications to the
+ remote hostname by modules like <module>mod_remoteip</module>.</td></tr>
+
<tr><td><code>%H</code></td>
<td>The request protocol.</td></tr>
static const char *log_remote_host(request_rec *r, char *a)
{
- return ap_escape_logitem(r->pool, ap_get_remote_host(r->connection,
- r->per_dir_config,
- REMOTE_NAME, NULL));
+ const char *remote_host;
+ if (a && !strcmp(a, "c")) {
+ remote_host = ap_get_remote_host(r->connection, r->per_dir_config,
+ REMOTE_NAME, NULL);
+ }
+ else {
+ remote_host = ap_get_useragent_host(r, REMOTE_NAME, NULL);
+ }
+ return ap_escape_logitem(r->pool, remote_host);
}
static const char *log_remote_address(request_rec *r, char *a)