httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cove...@apache.org
Subject svn commit: r1776459 - in /httpd/httpd/trunk: CHANGES docs/manual/expr.xml server/util_expr_eval.c
Date Thu, 29 Dec 2016 18:31:13 GMT
Author: covener
Date: Thu Dec 29 18:31:13 2016
New Revision: 1776459

URL: http://svn.apache.org/viewvc?rev=1776459&view=rev
Log:
PR59938: add %{REMOTE_PORT} to the expression parser

Submitted By: Hank Ibell <hwibell gmail.com>


Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/docs/manual/expr.xml
    httpd/httpd/trunk/server/util_expr_eval.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1776459&r1=1776458&r2=1776459&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Thu Dec 29 18:31:13 2016
@@ -1,5 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
+ 
+  *) core: Add %{REMOTE_PORT} to the expression parser. PR59938
+     [Hank Ibell <hwibell gmail.com>]
 
   *) mod_remoteip: When overriding the useragent address from X-Forwarded-For,
      zero out what had been initialized as the connection-level port.  PR59931.

Modified: httpd/httpd/trunk/docs/manual/expr.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/expr.xml?rev=1776459&r1=1776458&r2=1776459&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/expr.xml (original)
+++ httpd/httpd/trunk/docs/manual/expr.xml Thu Dec 29 18:31:13 2016
@@ -230,6 +230,8 @@ listfunction ::= listfuncname "<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</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>

Modified: httpd/httpd/trunk/server/util_expr_eval.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/util_expr_eval.c?rev=1776459&r1=1776458&r2=1776459&view=diff
==============================================================================
--- httpd/httpd/trunk/server/util_expr_eval.c (original)
+++ httpd/httpd/trunk/server/util_expr_eval.c Thu Dec 29 18:31:13 2016
@@ -1456,6 +1456,7 @@ static const char *request_var_names[] =
     "SERVER_PROTOCOL_VERSION",  /* 29 */
     "SERVER_PROTOCOL_VERSION_MAJOR",  /* 30 */
     "SERVER_PROTOCOL_VERSION_MINOR",  /* 31 */
+    "REMOTE_PORT",                    /* 32 */
     NULL
 };
 
@@ -1562,6 +1563,8 @@ static const char *request_var_fn(ap_exp
         case 9:     return "9";
         }
         return apr_psprintf(ctx->p, "%d", HTTP_VERSION_MINOR(r->proto_num));
+    case 32:
+        return apr_psprintf(ctx->p, "%u", ctx->c->client_addr->port);
     default:
         ap_assert(0);
         return NULL;



Mime
View raw message