httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject cvs commit: httpd-2.0/modules/metadata mod_setenvif.c
Date Tue, 12 Nov 2002 18:30:00 GMT
coar        2002/11/12 10:30:00

  Modified:    .        CHANGES
               modules/metadata mod_setenvif.c
  Log:
  	Add a SERVER_ADDR keyword to match the CGI environment variable,
  	to allow conditional setting according to the IP address on
  	which the server received the request.
  
  Revision  Changes    Path
  1.979     +4 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.978
  retrieving revision 1.979
  diff -u -u -r1.978 -r1.979
  --- CHANGES	11 Nov 2002 23:07:29 -0000	1.978
  +++ CHANGES	12 Nov 2002 18:29:59 -0000	1.979
  @@ -1,5 +1,9 @@
   Changes with Apache 2.0.44
   
  +  *) mod_setenvif: Add SERVER_ADDR special keyword to allow
  +     envariable setting according to the server IP address
  +     which received the request.  [Ken Coar]
  +
     *) mod_cgid: Terminate CGI scripts when the client connection 
        drops.  PR 8388  [Jeff Trawick]
   
  
  
  
  1.38      +10 -1     httpd-2.0/modules/metadata/mod_setenvif.c
  
  Index: mod_setenvif.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/metadata/mod_setenvif.c,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -u -r1.37 -r1.38
  --- mod_setenvif.c	4 Nov 2002 18:17:50 -0000	1.37
  +++ mod_setenvif.c	12 Nov 2002 18:30:00 -0000	1.38
  @@ -92,6 +92,8 @@
    *
    * Special values for 'name' are:
    *
  + *   server_addr      	IP address of interface on which request arrived
  + *			(analogous to SERVER_ADDR set in ap_add_common_vars())
    *   remote_host        Remote host name (if available)
    *   remote_addr        Remote IP address
    *   remote_user        Remote authenticated user (if any)
  @@ -143,7 +145,8 @@
       SPECIAL_REMOTE_USER,
       SPECIAL_REQUEST_URI,
       SPECIAL_REQUEST_METHOD,
  -    SPECIAL_REQUEST_PROTOCOL
  +    SPECIAL_REQUEST_PROTOCOL,
  +    SPECIAL_SERVER_ADDR
   };
   typedef struct {
       char *name;                 /* header name */
  @@ -376,6 +379,9 @@
           else if (!strcasecmp(fname, "request_protocol")) {
               new->special_type = SPECIAL_REQUEST_PROTOCOL;
           }
  +        else if (!strcasecmp(fname, "server_addr")) {
  +            new->special_type = SPECIAL_SERVER_ADDR;
  +        }
           else {
               new->special_type = SPECIAL_NOT;
               /* Handle fname as a regular expression.
  @@ -508,6 +514,9 @@
               switch (b->special_type) {
               case SPECIAL_REMOTE_ADDR:
                   val = r->connection->remote_ip;
  +                break;
  +            case SPECIAL_SERVER_ADDR:
  +                val = r->connection->local_ip;
                   break;
               case SPECIAL_REMOTE_HOST:
                   val =  ap_get_remote_host(r->connection, r->per_dir_config,
  
  
  

Mime
View raw message