httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n.@apache.org
Subject cvs commit: httpd-2.0/modules/mappers mod_rewrite.c
Date Mon, 12 Jan 2004 22:36:32 GMT
nd          2004/01/12 14:36:32

  Modified:    .        CHANGES
               modules/mappers mod_rewrite.c
  Log:
  make REMOTE_PORT available
  
  PR: 25772
  
  Revision  Changes    Path
  1.1362    +3 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.1361
  retrieving revision 1.1362
  diff -u -u -r1.1361 -r1.1362
  --- CHANGES	12 Jan 2004 21:19:58 -0000	1.1361
  +++ CHANGES	12 Jan 2004 22:36:32 -0000	1.1362
  @@ -2,6 +2,9 @@
   
     [Remove entries to the current 2.0 section below, when backported]
   
  +  *) Make REMOTE_PORT variable available in mod_rewrite.
  +     PR 25772.  [André Malo]
  +
     *) Allow unescaped error logs via compile time switch
        "-DAP_ERROR_LOG_UNESCAPED".
        [Geoffrey Young <geoff modperlcookbook.org>, André Malo]
  
  
  
  1.239     +6 -3      httpd-2.0/modules/mappers/mod_rewrite.c
  
  Index: mod_rewrite.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/mappers/mod_rewrite.c,v
  retrieving revision 1.238
  retrieving revision 1.239
  diff -u -u -r1.238 -r1.239
  --- mod_rewrite.c	1 Jan 2004 13:26:20 -0000	1.238
  +++ mod_rewrite.c	12 Jan 2004 22:36:32 -0000	1.239
  @@ -1829,12 +1829,15 @@
                   break;
   
               case 'O':
  -                if (*var == 'R' && !strcmp(var, "REMOTE_HOST")) {
  +                if (*var == 'S' && !strcmp(var, "SERVER_PORT")) {
  +                    return apr_psprintf(r->pool, "%u", ap_get_server_port(r));
  +                }
  +                else if (var[7] == 'H' && !strcmp(var, "REMOTE_HOST")) {
                       result = ap_get_remote_host(r->connection,r->per_dir_config,
                                                   REMOTE_NAME, NULL);
                   }
  -                else if (!strcmp(var, "SERVER_PORT")) {
  -                    return apr_psprintf(r->pool, "%u", ap_get_server_port(r));
  +                else if (!strcmp(var, "REMOTE_PORT")) {
  +                    return apr_itoa(r->pool, r->connection->remote_addr->port);
                   }
                   break;
   
  
  
  

Mime
View raw message