]> granicus.if.org Git - apache/commitdiff
Merge r1776459, r1788508 from trunk:
authorYann Ylavic <ylavic@apache.org>
Tue, 28 Mar 2017 21:30:09 +0000 (21:30 +0000)
committerYann Ylavic <ylavic@apache.org>
Tue, 28 Mar 2017 21:30:09 +0000 (21:30 +0000)
PR59938: add %{REMOTE_PORT} to the expression parser

Submitted By: Hank Ibell <hwibell gmail.com>

compat note for REMOTE_PORT

Submitted by: covener
Reviewed by: covener, ylavic, jchampion

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1789244 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
docs/manual/expr.xml
server/util_expr_eval.c

diff --git a/CHANGES b/CHANGES
index ca67dd5209e7eaa30e528f21a2b512eedaeb969b..a9336a34ce50196eb8b5814b625121191e75d349 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
 
 Changes with Apache 2.4.26
 
+  *) core: Add %{REMOTE_PORT} to the expression parser. PR59938
+     [Hank Ibell <hwibell gmail.com>]
+
   *) mod_cache: Fix a regression in 2.4.25 for the forward proxy case by
      computing and using the same entity key according to when the cache
      checks, loads and saves the request.
diff --git a/STATUS b/STATUS
index 62b1ed771ae81ca15d619ce9ea8eb49c253d552c..c31352e75e42cd4517cb5c3b7e9b71d428dd4592 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -118,14 +118,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-  *) core: Add %{REMOTE_PORT} to the expression parser. PR59938
-     trunk patch: http://svn.apache.org/r1776459
-                  http://svn.apache.org/r1788508
-     2.4.x patch: trunk works
-     +1: covener, ylavic, jchampion
-     jchampion: Trunk patches don't apply cleanly for me. The patch I used to
-                test is at https://home.apache.org/~jchampion/patches/2.4.x-expr-REMOTE_PORT.patch
-
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]
index 2572beac7e0d7aa7ae9d9987f14888f505b21511..2ac74811463a0a15a7d6cc3c025b0140346171c0 100644 (file)
@@ -225,6 +225,8 @@ listfunction ::= listfuncname "<strong>(</strong>" word "<strong>)</strong>"
             "<code>GET /index.html HTTP/1.1</code>")</td></tr>
     <tr><td><code>REMOTE_ADDR</code></td>
         <td>The IP address of the remote host</td></tr>
+    <tr><td><code>REMOTE_PORT</code></td>
+        <td>The port of the remote host (2.4.26 and later)</td></tr>
     <tr><td><code>REMOTE_HOST</code></td>
         <td>The host name of the remote host</td></tr>
     <tr><td><code>REMOTE_USER</code></td>
index 6659ea62a26b6e1ec8c820e2fa2758b00ba628ca..b1cb9235d1cb9a5632a16f72a9487b57a39ffaef 100644 (file)
@@ -1337,6 +1337,7 @@ static const char *request_var_names[] = {
     "CONTEXT_DOCUMENT_ROOT",    /* 26 */
     "REQUEST_STATUS",           /* 27 */
     "REMOTE_ADDR",              /* 28 */
+    "REMOTE_PORT",              /* 29 */
     NULL
 };
 
@@ -1426,6 +1427,8 @@ static const char *request_var_fn(ap_expr_eval_ctx_t *ctx, const void *data)
         return r->status ? apr_psprintf(ctx->p, "%d", r->status) : "";
     case 28:
         return r->useragent_ip;
+    case 29:
+        return apr_psprintf(ctx->p, "%u", ctx->c->client_addr->port);
     default:
         ap_assert(0);
         return NULL;