httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject cvs commit: httpd-2.0/server core.c scoreboard.c util_script.c
Date Fri, 09 Mar 2001 20:30:35 GMT
trawick     01/03/09 12:30:35

  Modified:    include  http_core.h
               modules/aaa mod_access.c
               modules/loggers mod_log_config.c
               modules/mappers mod_rewrite.c
               modules/metadata mod_setenvif.c mod_usertrack.c
               server   core.c scoreboard.c util_script.c
  Log:
  tweak ap_get_remote_host() so that the caller can find out if she got
  back an IP address
  
  mod_access needed to know this, but the old code didn't handle IPv6
  
  Revision  Changes    Path
  1.42      +4 -2      httpd-2.0/include/http_core.h
  
  Index: http_core.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/include/http_core.h,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- http_core.h	2001/02/22 08:42:09	1.41
  +++ http_core.h	2001/03/09 20:30:30	1.42
  @@ -184,10 +184,12 @@
    *                   setting.  The result is the (double reverse checked) 
    *                   hostname, or NULL if any of the lookups fail.
    * </PRE>
  + * @param str_is_ip unless NULL is passed, this will be set to non-zero on output when
an IP address 
  + *        string is returned
    * @return The remote hostname
  - * @deffunc const char *ap_get_remote_host(conn_rec *conn, void *dir_config, int type)
  + * @deffunc const char *ap_get_remote_host(conn_rec *conn, void *dir_config, int type,
int *str_is_ip)
    */
  -AP_DECLARE(const char *) ap_get_remote_host(conn_rec *conn, void *dir_config, int type);
  +AP_DECLARE(const char *) ap_get_remote_host(conn_rec *conn, void *dir_config, int type,
int *str_is_ip);
   
   /**
    * Retrieve the login name of the remote user.  Undef if it could not be
  
  
  
  1.30      +4 -2      httpd-2.0/modules/aaa/mod_access.c
  
  Index: mod_access.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/aaa/mod_access.c,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- mod_access.c	2001/02/16 04:26:34	1.29
  +++ mod_access.c	2001/03/09 20:30:31	1.30
  @@ -341,10 +341,12 @@
   
   	case T_HOST:
   	    if (!gothost) {
  +                int remotehost_is_ip;
  +
   		remotehost = ap_get_remote_host(r->connection, r->per_dir_config,
  -					    REMOTE_DOUBLE_REV);
  +                                                REMOTE_DOUBLE_REV, &remotehost_is_ip);
   
  -		if ((remotehost == NULL) || is_ip(remotehost))
  +		if ((remotehost == NULL) || remotehost_is_ip)
   		    gothost = 1;
   		else
   		    gothost = 2;
  
  
  
  1.52      +1 -1      httpd-2.0/modules/loggers/mod_log_config.c
  
  Index: mod_log_config.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/loggers/mod_log_config.c,v
  retrieving revision 1.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- mod_log_config.c	2001/02/22 04:05:58	1.51
  +++ mod_log_config.c	2001/03/09 20:30:32	1.52
  @@ -303,7 +303,7 @@
   static const char *log_remote_host(request_rec *r, char *a)
   {
       return ap_get_remote_host(r->connection, r->per_dir_config,
  -                                    REMOTE_NAME);
  +                                    REMOTE_NAME, NULL);
   }
   
   static const char *log_remote_address(request_rec *r, char *a)
  
  
  
  1.75      +2 -2      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.74
  retrieving revision 1.75
  diff -u -r1.74 -r1.75
  --- mod_rewrite.c	2001/03/03 01:46:16	1.74
  +++ mod_rewrite.c	2001/03/09 20:30:33	1.75
  @@ -3138,7 +3138,7 @@
       }
   
       rhost = ap_get_remote_host(conn, r->server->module_config, 
  -                               REMOTE_NOLOOKUP);
  +                               REMOTE_NOLOOKUP, NULL);
       if (rhost == NULL) {
           rhost = "UNKNOWN-HOST";
       }
  @@ -3409,7 +3409,7 @@
       }
       else if (strcasecmp(var, "REMOTE_HOST") == 0) {
           result = (char *)ap_get_remote_host(r->connection,
  -                                         r->per_dir_config, REMOTE_NAME);
  +                                            r->per_dir_config, REMOTE_NAME, NULL);
       }
       else if (strcasecmp(var, "REMOTE_USER") == 0) {
           result = r->user;
  
  
  
  1.27      +1 -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.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- mod_setenvif.c	2001/02/24 01:38:49	1.26
  +++ mod_setenvif.c	2001/03/09 20:30:33	1.27
  @@ -402,7 +402,7 @@
   		break;
   	    case SPECIAL_REMOTE_HOST:
   		val =  ap_get_remote_host(r->connection, r->per_dir_config,
  -					  REMOTE_NAME);
  +					  REMOTE_NAME, NULL);
   		break;
   	    case SPECIAL_REMOTE_USER:
   		val = r->user;
  
  
  
  1.30      +1 -1      httpd-2.0/modules/metadata/mod_usertrack.c
  
  Index: mod_usertrack.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/metadata/mod_usertrack.c,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- mod_usertrack.c	2001/02/16 04:26:41	1.29
  +++ mod_usertrack.c	2001/03/09 20:30:33	1.30
  @@ -138,7 +138,7 @@
       char cookiebuf[1024];
       char *new_cookie;
       const char *rname = ap_get_remote_host(r->connection, r->per_dir_config,
  -					   REMOTE_NAME);
  +					   REMOTE_NAME, NULL);
       cookie_dir_rec *dcfg;
   
       dcfg = ap_get_module_config(r->per_dir_config, &usertrack_module);
  
  
  
  1.2       +8 -1      httpd-2.0/server/core.c
  
  Index: core.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/core.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- core.c	2001/03/04 06:27:27	1.1
  +++ core.c	2001/03/09 20:30:34	1.2
  @@ -607,10 +607,14 @@
   }
   
   AP_DECLARE(const char *) ap_get_remote_host(conn_rec *conn, void *dir_config,
  -					    int type)
  +					    int type, int *str_is_ip)
   {
       int hostname_lookups;
   
  +    if (str_is_ip) { /* if caller wants to know */
  +        *str_is_ip = 0;
  +    }
  +
       /* If we haven't checked the host name, and we want to */
       if (dir_config) {
   	hostname_lookups =
  @@ -667,6 +671,9 @@
   	    return NULL;
   	}
   	else {
  +            if (str_is_ip) { /* if caller wants to know */
  +                *str_is_ip = 1;
  +            }
   	    return conn->remote_ip;
   	}
       }
  
  
  
  1.20      +1 -1      httpd-2.0/server/scoreboard.c
  
  Index: scoreboard.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/scoreboard.c,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- scoreboard.c	2001/03/02 22:46:31	1.19
  +++ scoreboard.c	2001/03/09 20:30:34	1.20
  @@ -300,7 +300,7 @@
   	if (r) {
   	    conn_rec *c = r->connection;
   	    apr_cpystrn(ss->client, ap_get_remote_host(c, r->per_dir_config,
  -				  REMOTE_NOLOOKUP), sizeof(ss->client));
  +				  REMOTE_NOLOOKUP, NULL), sizeof(ss->client));
   	    if (r->the_request == NULL) {
   		    apr_cpystrn(ss->request, "NULL", sizeof(ss->request));
   	    } else if (r->parsed_uri.password == NULL) {
  
  
  
  1.56      +1 -1      httpd-2.0/server/util_script.c
  
  Index: util_script.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/util_script.c,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  --- util_script.c	2001/02/16 04:26:48	1.55
  +++ util_script.c	2001/03/09 20:30:34	1.56
  @@ -247,7 +247,7 @@
       apr_table_addn(e, "SERVER_ADDR", r->connection->local_ip);	/* Apache */
       apr_table_addn(e, "SERVER_PORT",
   		  apr_psprintf(r->pool, "%u", ap_get_server_port(r)));
  -    host = ap_get_remote_host(c, r->per_dir_config, REMOTE_HOST);
  +    host = ap_get_remote_host(c, r->per_dir_config, REMOTE_HOST, NULL);
       if (host) {
   	apr_table_addn(e, "REMOTE_HOST", host);
       }
  
  
  

Mime
View raw message