httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dr...@locus.apache.org
Subject cvs commit: apache-2.0/src/main http_connection.c http_vhost.c listen.c rfc1413.c
Date Thu, 09 Nov 2000 15:09:52 GMT
dreid       00/11/09 07:09:51

  Modified:    src/main http_connection.c http_vhost.c listen.c rfc1413.c
  Log:
  Change the code to reflect the recent API changes...
  Alter http_vhost.c to use the new apr_get_inaddr fucntion.  Old code is still
  there just in case it breaks.  can someone check it who knows this stuff?
  
  Revision  Changes    Path
  1.61      +2 -2      apache-2.0/src/main/http_connection.c
  
  Index: http_connection.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/http_connection.c,v
  retrieving revision 1.60
  retrieving revision 1.61
  diff -u -r1.60 -r1.61
  --- http_connection.c	2000/11/09 00:36:49	1.60
  +++ http_connection.c	2000/11/09 15:09:50	1.61
  @@ -284,12 +284,12 @@
   
       conn->pool = p;
       conn->local_addr = *saddr;
  -    apr_get_local_ipaddr(&conn->local_ip, inout);
  +    apr_get_ipaddr(&conn->local_ip, APR_LOCAL, inout);
       conn->base_server = server;
       conn->client_socket = inout;
   
       conn->remote_addr = *remaddr;
  -    apr_get_remote_ipaddr(&conn->remote_ip, inout);   
  +    apr_get_ipaddr(&conn->remote_ip, APR_REMOTE, inout);   
       conn->id = id;
   
       return conn;
  
  
  
  1.35      +21 -7     apache-2.0/src/main/http_vhost.c
  
  Index: http_vhost.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/http_vhost.c,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- http_vhost.c	2000/11/08 14:47:25	1.34
  +++ http_vhost.c	2000/11/09 15:09:50	1.35
  @@ -187,7 +187,7 @@
   				 server_addr_rec ***paddr, apr_port_t port)
   {
       struct hostent *hep;
  -    unsigned long my_addr;
  +    apr_in_addr my_addr;
       server_addr_rec *sar;
       char *t;
       int i, is_an_ip_addr;
  @@ -211,27 +211,41 @@
   	*t = 0;
       }
   
  -    is_an_ip_addr = 0;
  +    if (strcasecmp(w, "_default_") == 0
  +        || strcmp(w, "255.255.255.255") == 0) {
  +        my_addr.s_addr = DEFAULT_VHOST_ADDR;
  +    } else {
  +        if (apr_get_inaddr(&my_addr, w) != APR_SUCCESS) {
  +            ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, NULL,
  +                "Cannot resolve host name %s --- ignoring!", w);
  +            return NULL;
  +        }
  +    }
  +
  +/*        
  +   is_an_ip_addr = 0;
       if (strcmp(w, "*") == 0) {
  -	my_addr = htonl(INADDR_ANY);
  +	my_addr.s_addr = htonl(INADDR_ANY);
   	is_an_ip_addr = 1;
       }
       else if (strcasecmp(w, "_default_") == 0
   	     || strcmp(w, "255.255.255.255") == 0) {
  -	my_addr = DEFAULT_VHOST_ADDR;
  +	my_addr.s_addr = DEFAULT_VHOST_ADDR;
   	is_an_ip_addr = 1;
       }
  -    else if ((my_addr = apr_inet_addr(w)) != INADDR_NONE) {
  +    else if ((my_addr.s_addr = apr_inet_addr(w)) != INADDR_NONE) {
   	is_an_ip_addr = 1;
       }
       if (is_an_ip_addr) {
  +*/
   	sar = apr_pcalloc(p, sizeof(server_addr_rec));
   	**paddr = sar;
   	*paddr = &sar->next;
  -	sar->host_addr.s_addr = my_addr;
  +	sar->host_addr = my_addr;
   	sar->host_port = port;
   	sar->virthost = apr_pstrdup(p, w);
   	return NULL;
  +/*
       }
   
       hep = gethostbyname(w);
  @@ -250,7 +264,7 @@
   	sar->host_port = port;
   	sar->virthost = apr_pstrdup(p, w);
       }
  -
  +*/
       return NULL;
   }
   
  
  
  
  1.35      +3 -3      apache-2.0/src/main/listen.c
  
  Index: listen.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/listen.c,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- listen.c	2000/11/08 14:47:28	1.34
  +++ listen.c	2000/11/09 15:09:50	1.35
  @@ -87,7 +87,7 @@
       char *ipaddr;
   
       apr_get_port(&port, APR_LOCAL, s);
  -    apr_get_local_ipaddr(&ipaddr,s);
  +    apr_get_ipaddr(&ipaddr, APR_LOCAL, s);
       apr_snprintf(addr, sizeof(addr), "address %s port %u", ipaddr,
   		(unsigned) port);
   
  @@ -183,7 +183,7 @@
       /* see if we've got an old listener for this address:port */
       for (walk = &old_listeners; *walk; walk = &(*walk)->next) {
           apr_get_port(&oldport, APR_LOCAL, (*walk)->sd);
  -	apr_get_local_ipaddr(&oldaddr,(*walk)->sd);
  +	apr_get_ipaddr(&oldaddr, APR_LOCAL, (*walk)->sd);
   	if (!strcmp(oldaddr, addr) && port == oldport) {
   	    /* re-use existing record */
   	    new = *walk;
  @@ -203,7 +203,7 @@
           return;
       }
       apr_set_port(new->sd, APR_LOCAL, port);
  -    apr_set_local_ipaddr(new->sd, addr);
  +    apr_set_ipaddr(new->sd, APR_LOCAL, addr);
       new->next = ap_listeners;
       ap_listeners = new;
   }
  
  
  
  1.28      +2 -2      apache-2.0/src/main/rfc1413.c
  
  Index: rfc1413.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/main/rfc1413.c,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- rfc1413.c	2000/11/08 16:42:05	1.27
  +++ rfc1413.c	2000/11/09 15:09:50	1.28
  @@ -130,7 +130,7 @@
        */
   
       apr_set_port(sock, APR_LOCAL, ANY_PORT);
  -    apr_set_local_ipaddr(sock, local_ip);
  +    apr_set_ipaddr(sock, APR_LOCAL, local_ip);
   
       if ((status = apr_bind(sock)) != APR_SUCCESS) {
   	ap_log_error(APLOG_MARK, APLOG_CRIT, status, srv,
  @@ -143,7 +143,7 @@
    * the service
    */
       apr_set_port(sock, APR_REMOTE, RFC1413_PORT);
  -    apr_set_remote_ipaddr(sock, rmt_ip);
  +    apr_set_ipaddr(sock, APR_REMOTE, rmt_ip);
                       
       if (apr_connect(sock, NULL) != APR_SUCCESS)
           return -1;
  
  
  

Mime
View raw message