Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 8751F200BEC for ; Thu, 29 Dec 2016 19:31:16 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 85F1B160B2D; Thu, 29 Dec 2016 18:31:16 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D12C9160B23 for ; Thu, 29 Dec 2016 19:31:15 +0100 (CET) Received: (qmail 56942 invoked by uid 500); 29 Dec 2016 18:31:15 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 56929 invoked by uid 99); 29 Dec 2016 18:31:15 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Dec 2016 18:31:15 +0000 Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 6153F3A03A6 for ; Thu, 29 Dec 2016 18:31:14 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: cvs@httpd.apache.org From: covener@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20161229183114.6153F3A03A6@svn01-us-west.apache.org> archived-at: Thu, 29 Dec 2016 18:31:16 -0000 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 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 ] *) 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 "( "GET /index.html HTTP/1.1") REMOTE_ADDR The IP address of the remote host + REMOTE_PORT + The port of the remote host REMOTE_HOST The host name of the remote host REMOTE_USER 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;