You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ji...@apache.org on 2014/02/10 19:54:24 UTC
svn commit: r1566702 - in /httpd/httpd/branches/2.4.x: ./ CHANGES STATUS
docs/manual/ docs/manual/mod/ docs/manual/mod/mod_rewrite.xml
modules/mappers/mod_rewrite.c
Author: jim
Date: Mon Feb 10 18:54:23 2014
New Revision: 1566702
URL: http://svn.apache.org/r1566702
Log:
Merge r1563418 from trunk:
Add %{CONN_REMOTE_ADDR} to mod_rewrite. PR56094
Submitted By: Edward Lu <Chaosed0 gmail com>
Committed By: covener
Submitted by: covener
Reviewed/backported by: jim
Modified:
httpd/httpd/branches/2.4.x/ (props changed)
httpd/httpd/branches/2.4.x/CHANGES
httpd/httpd/branches/2.4.x/STATUS
httpd/httpd/branches/2.4.x/docs/manual/ (props changed)
httpd/httpd/branches/2.4.x/docs/manual/mod/ (props changed)
httpd/httpd/branches/2.4.x/docs/manual/mod/mod_rewrite.xml
httpd/httpd/branches/2.4.x/modules/mappers/mod_rewrite.c
Propchange: httpd/httpd/branches/2.4.x/
------------------------------------------------------------------------------
Merged /httpd/httpd/trunk:r1563418
Modified: httpd/httpd/branches/2.4.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/CHANGES?rev=1566702&r1=1566701&r2=1566702&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.4.x/CHANGES [utf-8] Mon Feb 10 18:54:23 2014
@@ -2,6 +2,9 @@
Changes with Apache 2.4.8
+ *) mod_rewrite: Add %{CONN_REMOTE_ADDR} as the non-useragent counterpart to
+ %{REMOTE_ADDR}. PR 56094. [Edward Lu <Chaosed0 gmail com>]
+
*) WinNT MPM: If ap_run_pre_connection() fails or sets c->aborted, don't
save the socket for reuse by the next worker as if it were an
APR_SO_DISCONNECTED socket. Restores 2.2 behavior. [Eric Covener]
Modified: httpd/httpd/branches/2.4.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/STATUS?rev=1566702&r1=1566701&r2=1566702&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/STATUS (original)
+++ httpd/httpd/branches/2.4.x/STATUS Mon Feb 10 18:54:23 2014
@@ -98,13 +98,6 @@ RELEASE SHOWSTOPPERS:
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]
- * mod_rewrite: Add %{CONN_REMOTE_ADDR} to mod_rewrite PR56094
- trunk patch: https://svn.apache.org/r1563418
- 2.4.x patch: trunk works
- +1: covener, jim, mrumph
- mrumph: Verified the change against comment 1 in PR 55886.
- Also, verified the source change against log_remote_address()
- in modules/loggers/mod_log_config.c in both trunk and 2.4.x.
PATCHES PROPOSED TO BACKPORT FROM TRUNK:
Propchange: httpd/httpd/branches/2.4.x/docs/manual/
------------------------------------------------------------------------------
Merged /httpd/httpd/trunk/docs/manual:r1563418
Propchange: httpd/httpd/branches/2.4.x/docs/manual/mod/
------------------------------------------------------------------------------
Merged /httpd/httpd/trunk/docs/manual/mod:r1563418
Modified: httpd/httpd/branches/2.4.x/docs/manual/mod/mod_rewrite.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/docs/manual/mod/mod_rewrite.xml?rev=1566702&r1=1566701&r2=1566702&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/docs/manual/mod/mod_rewrite.xml (original)
+++ httpd/httpd/branches/2.4.x/docs/manual/mod/mod_rewrite.xml Mon Feb 10 18:54:23 2014
@@ -446,6 +446,7 @@ Alias /myapp /opt/myapp-1.2.3
<td>
REMOTE_ADDR<br />
+ CONN_REMOTE_ADDR<br />
REMOTE_HOST<br />
REMOTE_PORT<br />
REMOTE_USER<br />
@@ -574,6 +575,14 @@ Alias /myapp /opt/myapp-1.2.3
"http" or "https"). This value can be influenced with
<directive module="core">ServerName</directive>.</dd>
+ <dt><code>REMOTE_ADDR</code></dt>
+ <dd>The IP address of the remote host (see the
+ <module>mod_remoteip</module> module).</dd>
+
+ <dt><code>CONN_REMOTE_ADDR</code></dt>
+ <dd>Since 2.4.8: The peer IP address of the connection (see the
+ <module>mod_remoteip</module> module).</dd>
+
</dl>
</note>
</li>
Modified: httpd/httpd/branches/2.4.x/modules/mappers/mod_rewrite.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/mappers/mod_rewrite.c?rev=1566702&r1=1566701&r2=1566702&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/mappers/mod_rewrite.c (original)
+++ httpd/httpd/branches/2.4.x/modules/mappers/mod_rewrite.c Mon Feb 10 18:54:23 2014
@@ -2139,7 +2139,10 @@ static char *lookup_variable(char *var,
break;
case 16:
- if (!strcmp(var, "REQUEST_FILENAME")) {
+ if (*var == 'C' && !strcmp(var, "CONN_REMOTE_ADDR")) {
+ result = r->connection->client_ip;
+ }
+ else if (!strcmp(var, "REQUEST_FILENAME")) {
result = r->filename; /* same as script_filename (15) */
}
break;