You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@locus.apache.org on 2000/12/14 19:47:34 UTC

cvs commit: httpd-2.0/server connection.c vhost.c

trawick     00/12/14 10:47:33

  Modified:    include  httpd.h
               modules/aaa mod_access.c
               modules/dav/main util.c
               modules/http http_core.c
               server   connection.c vhost.c
  Log:
  The local_addr and remote_addr fields in the conn_rec are now
  apr_sockaddr_t * instead of sockaddr_in.  This is a small step
  towards IPv6 support.
  
  Revision  Changes    Path
  1.124     +2 -6      httpd-2.0/include/httpd.h
  
  Index: httpd.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/include/httpd.h,v
  retrieving revision 1.123
  retrieving revision 1.124
  diff -u -r1.123 -r1.124
  --- httpd.h	2000/12/12 22:22:51	1.123
  +++ httpd.h	2000/12/14 18:47:19	1.124
  @@ -86,10 +86,6 @@
   #include "apr_time.h"
   #include "apr_network_io.h"
   
  -#ifdef HAVE_NETINET_IN_H
  -#include <netinet/in.h>
  -#endif
  -
   #ifdef CORE_PRIVATE
   
   /* ----------------------------- config dir ------------------------------ */
  @@ -839,9 +835,9 @@
       /* Who is the client? */
   
       /** local address */
  -    struct sockaddr_in local_addr;
  +    apr_sockaddr_t *local_addr;
       /** remote address */
  -    struct sockaddr_in remote_addr;
  +    apr_sockaddr_t *remote_addr;
       /** Client's IP address */
       char *remote_ip;
       /** Client's DNS name, if known.  NULL if DNS hasn't been checked,
  
  
  
  1.22      +3 -1      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.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- mod_access.c	2000/11/11 06:06:00	1.21
  +++ mod_access.c	2000/12/14 18:47:22	1.22
  @@ -334,8 +334,10 @@
   	    return 1;
   
   	case T_IP:
  +            /* XXX handle IPv6 with separate T_IP6 type or add common 
  +             *     address masking operations to APR */
   	    if (ap[i].x.ip.net != APR_INADDR_NONE
  -		&& (r->connection->remote_addr.sin_addr.s_addr
  +		&& (r->connection->remote_addr->sa.sin.sin_addr.s_addr
   		    & ap[i].x.ip.mask) == ap[i].x.ip.net) {
   		return 1;
   	    }
  
  
  
  1.16      +2 -1      httpd-2.0/modules/dav/main/util.c
  
  Index: util.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/dav/main/util.c,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- util.c	2000/11/23 10:08:19	1.15
  +++ util.c	2000/12/14 18:47:25	1.16
  @@ -183,7 +183,7 @@
   {
       dav_lookup_result result = { 0 };
       const char *scheme;
  -    unsigned short port = ntohs(r->connection->local_addr.sin_port);
  +    apr_port_t port;
       uri_components comp;
       char *new_file;
       const char *domain;
  @@ -215,6 +215,7 @@
          the port, must match our port.
          the URI must not have a query (args) or a fragment
        */
  +    apr_get_port(&port, r->connection->local_addr);
       if (strcasecmp(comp.scheme, scheme) != 0 ||
   	comp.port != port) {
   	result.err.status = HTTP_BAD_GATEWAY;
  
  
  
  1.228     +1 -1      httpd-2.0/modules/http/http_core.c
  
  Index: http_core.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/http/http_core.c,v
  retrieving revision 1.227
  retrieving revision 1.228
  diff -u -r1.227 -r1.228
  --- http_core.c	2000/11/28 18:57:30	1.227
  +++ http_core.c	2000/12/14 18:47:27	1.228
  @@ -603,7 +603,7 @@
   
   	for (haddr = hptr->h_addr_list; *haddr; haddr++) {
   	    if (((struct in_addr *)(*haddr))->s_addr
  -		== conn->remote_addr.sin_addr.s_addr) {
  +		== conn->remote_addr->sa.sin.sin_addr.s_addr) {
   		conn->double_reverse = 1;
   		return;
   	    }
  
  
  
  1.66      +4 -7      httpd-2.0/server/connection.c
  
  Index: connection.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/connection.c,v
  retrieving revision 1.65
  retrieving revision 1.66
  diff -u -r1.65 -r1.66
  --- connection.c	2000/12/04 19:23:18	1.65
  +++ connection.c	2000/12/14 18:47:29	1.66
  @@ -272,7 +272,6 @@
                               apr_socket_t *inout, long id)
   {
       conn_rec *conn = (conn_rec *) apr_pcalloc(p, sizeof(conn_rec));
  -    apr_sockaddr_t *sa;
   
       /* Got a connection structure, so initialize what fields we can
        * (the rest are zeroed out by pcalloc).
  @@ -282,15 +281,13 @@
       conn->notes = apr_make_table(p, 5);
   
       conn->pool = p;
  -    apr_get_sockaddr(&sa, APR_LOCAL, inout);
  -    conn->local_addr = sa->sa.sin;
  -    apr_get_ipaddr(&conn->local_ip, sa);
  +    apr_get_sockaddr(&conn->local_addr, APR_LOCAL, inout);
  +    apr_get_ipaddr(&conn->local_ip, conn->local_addr);
  +    apr_get_sockaddr(&conn->remote_addr, APR_REMOTE, inout);
  +    apr_get_ipaddr(&conn->remote_ip, conn->remote_addr);
       conn->base_server = server;
       conn->client_socket = inout;
   
  -    apr_get_sockaddr(&sa, APR_REMOTE, inout);
  -    conn->remote_addr = sa->sa.sin;
  -    apr_get_ipaddr(&conn->remote_ip, sa);   
       conn->id = id;
   
       return conn;
  
  
  
  1.41      +3 -4      httpd-2.0/server/vhost.c
  
  Index: vhost.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/vhost.c,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- vhost.c	2000/11/21 19:10:18	1.40
  +++ vhost.c	2000/12/14 18:47:30	1.41
  @@ -967,13 +967,12 @@
   {
       ipaddr_chain *trav;
       apr_port_t port;
  -    apr_sockaddr_t *localsa;
   
  -    apr_get_sockaddr(&localsa, APR_LOCAL, conn->client_socket);
  -    apr_get_port(&port, localsa);
  +    apr_get_port(&port, conn->local_addr);
   
       /* scan the hash apr_table_t for an exact match first */
  -    trav = find_ipaddr(&conn->local_addr.sin_addr, port);
  +    /* XXX IPv6 issues handled in an uncommitted patch */
  +    trav = find_ipaddr(&conn->local_addr->sa.sin.sin_addr, port);
       if (trav) {
   	/* save the name_chain for later in case this is a name-vhost */
   	conn->vhost_lookup_data = trav->names;