httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@locus.apache.org
Subject cvs commit: apache-2.0/src CHANGES
Date Fri, 17 Nov 2000 03:45:05 GMT
trawick     00/11/16 19:45:05

  Modified:    src/lib/apr/include apr_network_io.h
               src/lib/apr/network_io/unix sa_common.c sockets.c
               src/lib/apr/test client.c testsf.c
               src/main rfc1413.c
               src/modules/proxy proxy_util.c
               src/support ab.c httpd.exp
               src/lib/apr/network_io/win32 sockets.c
               src/lib/apr/network_io/os2 sockets.c
               src/lib/apr aprlib.def
               src      CHANGES
  Log:
  APR: Change apr_connect() to take apr_sockaddr_t instead of hostname.
  Add generic apr_create_socket().  Add apr_getaddrinfo() for doing
  hostname resolution/address string parsing and building
  apr_sockaddr_t.
  Submitted by:	David Reid
  Reviewed by:	Jeff Trawick
  
  Revision  Changes    Path
  1.72      +18 -1     apache-2.0/src/lib/apr/include/apr_network_io.h
  
  Index: apr_network_io.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr_network_io.h,v
  retrieving revision 1.71
  retrieving revision 1.72
  diff -u -r1.71 -r1.72
  --- apr_network_io.h	2000/11/16 14:48:50	1.71
  +++ apr_network_io.h	2000/11/17 03:45:01	1.72
  @@ -265,7 +265,7 @@
    *                 APR assumes that the sockaddr_in in the apr_socket is 
    *                 completely filled out.
    */
  -apr_status_t apr_connect(apr_socket_t *sock, const char *hostname);
  +apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa);
   
   /**
    * Get name of a machine we are currently connected to.
  @@ -274,6 +274,23 @@
    * @param sock The socket to examine.
    */
   apr_status_t apr_get_hostname(char **name, apr_interface_e which, apr_socket_t *sock);
  +
  +/**
  + * Create apr_sockaddr_t from hostname, address family, and port.
  + * @param sa The new apr_sockaddr_t.
  + * @param hostname The hostname or numeric address string to resolve/parse.
  + * @param family The address family to use, or AF_UNSPEC if the system should 
  + * decide.
  + * @param port The port number.
  + * @param flags Special processing flags.
  + * @param p The pool for the apr_sockaddr_t and associated storage.
  + */
  +apr_status_t apr_getaddrinfo(apr_sockaddr_t **sa, 
  +                             const char *hostname,
  +                             apr_int32_t family,
  +                             apr_port_t port,
  +                             apr_int32_t flags,
  +                             apr_pool_t *p);
   
   /**
    * Get name of the current machine
  
  
  
  1.7       +61 -0     apache-2.0/src/lib/apr/network_io/unix/sa_common.c
  
  Index: sa_common.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/unix/sa_common.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- sa_common.c	2000/11/16 14:48:49	1.6
  +++ sa_common.c	2000/11/17 03:45:01	1.7
  @@ -171,3 +171,64 @@
       return APR_SUCCESS;
   }
   
  +static void set_sockaddr_vars(apr_sockaddr_t *addr, int family)
  +{
  +    addr->sa.sin.sin_family = family;
  +
  +    if (family == AF_INET) {
  +        addr->sa_len = sizeof(struct sockaddr_in);
  +        addr->addr_str_len = 16;
  +        addr->ipaddr_ptr = &(addr->sa.sin.sin_addr);
  +        addr->ipaddr_len = sizeof(struct in_addr);
  +    }
  +#if APR_HAVE_IPV6
  +    else if (family == AF_INET6) {
  +        addr->sa_len = sizeof(struct sockaddr_in6);
  +        addr->addr_str_len = 46;
  +        addr->ipaddr_ptr = &(addr->sa.sin6.sin6_addr);
  +        addr->ipaddr_len = sizeof(struct in6_addr);
  +    }
  +#endif
  +}
  +
  +apr_status_t apr_getaddrinfo(apr_sockaddr_t **sa, const char *hostname, 
  +                             apr_int32_t family, apr_port_t port,
  +                             apr_int32_t flags, apr_pool_t *p)
  +{
  +    struct hostent *hp;
  +
  +    (*sa) = (apr_sockaddr_t *)apr_pcalloc(p, sizeof(apr_sockaddr_t));
  +    if ((*sa) == NULL)
  +        return APR_ENOMEM;
  +    (*sa)->pool = p;
  +    (*sa)->sa.sin.sin_family = AF_INET; /* we don't yet support IPv6 */
  +    (*sa)->sa.sin.sin_port = htons(port);
  +    set_sockaddr_vars(*sa, (*sa)->sa.sin.sin_family);
  +
  +    if (hostname != NULL) {
  +#ifndef GETHOSTBYNAME_HANDLES_NAS
  +        if (*hostname >= '0' && *hostname <= '9' &&
  +            strspn(hostname, "0123456789.") == strlen(hostname)) {
  +            (*sa)->sa.sin.sin_addr.s_addr = inet_addr(hostname);
  +            (*sa)->sa_len = sizeof(struct sockaddr_in);
  +        }
  +        else {
  +#endif
  +        hp = gethostbyname(hostname);
  +
  +        if (!hp)  {
  +            return (h_errno + APR_OS_START_SYSERR);
  +        }
  +
  +        memcpy((char *)&(*sa)->sa.sin.sin_addr, hp->h_addr_list[0],
  +               hp->h_length);
  +        (*sa)->sa_len = sizeof(struct sockaddr_in);
  +        (*sa)->ipaddr_len = hp->h_length;
  +
  +#ifndef GETHOSTBYNAME_HANDLES_NAS
  +        }
  +#endif
  +    }
  +   (*sa)->hostname = apr_pstrdup(p, hostname);
  +    return APR_SUCCESS;
  +}
  
  
  
  1.57      +11 -33    apache-2.0/src/lib/apr/network_io/unix/sockets.c
  
  Index: sockets.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/unix/sockets.c,v
  retrieving revision 1.56
  retrieving revision 1.57
  diff -u -r1.56 -r1.57
  --- sockets.c	2000/11/16 14:48:49	1.56
  +++ sockets.c	2000/11/17 03:45:01	1.57
  @@ -168,7 +168,7 @@
                (struct sockaddr *)&sock->local_addr->sa, sock->local_addr->sa_len)
== -1)
           return errno;
       else {
  -        /* XXX fix me for IPv6 */
  +        /* XXX IPv6 - this assumes sin_port and sin6_port at same offset */
           if (sock->local_addr->sa.sin.sin_port == 0) { /* no need for ntohs() when
comparing w/ 0 */
               sock->local_port_unknown = 1; /* kernel got us an ephemeral port */
           }
  @@ -226,57 +226,35 @@
       return APR_SUCCESS;
   }
   
  -apr_status_t apr_connect(apr_socket_t *sock, const char *hostname)
  +apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa)
   {
  -    struct hostent *hp;
  -
       if ((sock->socketdes < 0) || (!sock->remote_addr)) {
           return APR_ENOTSOCK;
       }
  -    if (hostname != NULL) {
  -#ifndef GETHOSTBYNAME_HANDLES_NAS
  -        if (*hostname >= '0' && *hostname <= '9' &&
  -            strspn(hostname, "0123456789.") == strlen(hostname)) {
  -            sock->remote_addr->sa.sin.sin_addr.s_addr = inet_addr(hostname);
  -        }
  -        else {
  -#endif
  -        hp = gethostbyname(hostname);
  -
  -        if (!hp)  {
  -            return (h_errno + APR_OS_START_SYSERR);
  -        }
  -
  -        /* XXX IPv6: move name resolution out of this function */
  -        memcpy((char *)&sock->remote_addr->sa.sin.sin_addr, hp->h_addr_list[0],

  -               hp->h_length);
  -
  -#ifndef GETHOSTBYNAME_HANDLES_NAS
  -        }
  -#endif
  -    }
   
  -    if ((connect(sock->socketdes, 
  -                 (const struct sockaddr *)&sock->remote_addr->sa.sin,
  -                 sock->remote_addr->sa_len) < 0) &&
  +    if ((connect(sock->socketdes,
  +                 (const struct sockaddr *)&sa->sa.sin,
  +                 sa->sa_len) < 0) &&
           (errno != EINPROGRESS)) {
           return errno;
       }
       else {
  -        /* XXX IPv6 */
  +        sock->remote_addr = sa;
  +        /* XXX IPv6 assumes sin_port and sin6_port at same offset */
           if (sock->local_addr->sa.sin.sin_port == 0) {
               /* connect() got us an ephemeral port */
               sock->local_port_unknown = 1;
           }
  -        /* XXX IPv6 */
  -        if (sock->local_addr->sa.sin.sin_addr.s_addr == 0) {
  +        /* XXX IPv6 to be handled better later... */
  +        if (sock->local_addr->sa.sin.sin_family == AF_INET6 ||
  +            sock->local_addr->sa.sin.sin_addr.s_addr == 0) {
               /* not bound to specific local interface; connect() had to assign
                * one for the socket
                */
               sock->local_interface_unknown = 1;
           }
   #ifndef HAVE_POLL
  -	sock->connected=1;
  +        sock->connected=1;
   #endif
           return APR_SUCCESS;
       }
  
  
  
  1.18      +7 -5      apache-2.0/src/lib/apr/test/client.c
  
  Index: client.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/test/client.c,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- client.c	2000/11/09 15:01:35	1.17
  +++ client.c	2000/11/17 03:45:01	1.18
  @@ -73,6 +73,7 @@
       char *dest = "127.0.0.1";
       apr_port_t local_port, remote_port;
       apr_interval_time_t read_timeout = -1;
  +    apr_sockaddr_t *destsa;
   
       setbuf(stdout, NULL);
       if (argc > 1) {
  @@ -115,17 +116,18 @@
           fprintf(stdout, "OK\n");
       }
   
  -    fprintf(stdout, "\tClient:  Setting port for socket.......");
  -    if (apr_set_port(sock, APR_REMOTE, 8021) != APR_SUCCESS) {
  +    fprintf(stdout,"\tClient:  Making socket address...............");
  +    if (apr_getaddrinfo(&destsa, dest, AF_INET, 8021, 0, context) != APR_SUCCESS) {
           apr_close_socket(sock);
  -        fprintf(stderr, "Couldn't set the port correctly\n");
  +        fprintf(stdout, "Failed!\n");
  +        fprintf(stdout, "Couldn't create a socket address structure for %s\n", dest);
           exit(-1);
       }
  -    fprintf(stdout, "OK\n");           
  +    fprintf(stdout,"OK\n");
   
       fprintf(stdout, "\tClient:  Connecting to socket.......");
   
  -    stat = apr_connect(sock, dest);
  +    stat = apr_connect(sock, destsa);
   
       if (stat != APR_SUCCESS) {
           apr_close_socket(sock);
  
  
  
  1.14      +4 -3      apache-2.0/src/lib/apr/test/testsf.c
  
  Index: testsf.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/test/testsf.c,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- testsf.c	2000/11/14 19:32:26	1.13
  +++ testsf.c	2000/11/17 03:45:01	1.14
  @@ -205,6 +205,7 @@
       apr_pollfd_t *pfd;
       apr_int32_t nsocks;
       int i;
  +    apr_sockaddr_t *destsa;
   
       apr_setup(&p, &sock);
       create_testfile(p, TESTFILE);
  @@ -217,15 +218,15 @@
           exit(1);
       }
   
  -    rv = apr_set_port(sock, APR_REMOTE, TESTSF_PORT);
  +    rv = apr_getaddrinfo(&destsa, "127.0.0.1", AF_INET, TESTSF_PORT, 0, p);
       if (rv != APR_SUCCESS) {
  -        fprintf(stderr, "apr_set_remote_port()->%d/%s\n",
  +        fprintf(stderr, "apr_getaddrinfo()->%d/%s\n",
                   rv,
                   apr_strerror(rv, buf, sizeof buf));
           exit(1);
       }
   
  -    rv = apr_connect(sock, "127.0.0.1");
  +    rv = apr_connect(sock, destsa);
       if (rv != APR_SUCCESS) {
           fprintf(stderr, "apr_connect()->%d/%s\n", 
                   rv,
  
  
  
  1.29      +13 -7     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.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- rfc1413.c	2000/11/09 15:09:50	1.28
  +++ rfc1413.c	2000/11/17 03:45:02	1.29
  @@ -108,8 +108,8 @@
   
   /* bind_connect - bind both ends of a socket */
   /* Ambarish fix this. Very broken */
  -static int get_rfc1413(apr_socket_t *sock, const char *local_ip,
  -		       const char *rmt_ip, 
  +static int get_rfc1413(apr_socket_t *sock, apr_pool_t *p, 
  +                       const char *local_ip, const char *rmt_ip, 
   		       char user[RFC1413_USERLEN+1], server_rec *srv)
   {
       apr_port_t rmt_port, our_port;
  @@ -119,6 +119,7 @@
       char *cp;
       char buffer[RFC1413_MAXDATA + 1];
       int buflen;
  +    apr_sockaddr_t *destsa;
   
       /*
        * Bind the local and remote ends of the query socket to the same
  @@ -138,14 +139,19 @@
   	return -1;
       }
   
  +    if ((status = apr_getaddrinfo(&destsa, rmt_ip, AF_INET, RFC1413_PORT, 0,
  +                                  p)) != APR_SUCCESS) {
  +        /* This should not fail since we have a numeric address string
  +         * as the host. */
  +        ap_log_error(APLOG_MARK, APLOG_CRIT, status, srv,
  +                     "rfc1413: apr_getaddrinfo() failed");
  +        return -1;
  +    }
   /*
    * errors from connect usually imply the remote machine doesn't support
    * the service
    */
  -    apr_set_port(sock, APR_REMOTE, RFC1413_PORT);
  -    apr_set_ipaddr(sock, APR_REMOTE, rmt_ip);
  -                    
  -    if (apr_connect(sock, NULL) != APR_SUCCESS)
  +    if (apr_connect(sock, destsa) != APR_SUCCESS)
           return -1;
       apr_get_port(&sav_our_port, APR_LOCAL, sock);
       apr_get_port(&sav_rmt_port, APR_REMOTE, sock);
  @@ -235,7 +241,7 @@
   	conn->remote_logname = result;
       }
   
  -    if (get_rfc1413(sock, conn->local_ip, conn->remote_ip, user, srv) >= 0)
  +    if (get_rfc1413(sock, conn->pool, conn->local_ip, conn->remote_ip, user, srv)
>= 0)
           result = user;
       apr_close_socket(sock);
       conn->remote_logname = result;
  
  
  
  1.28      +5 -15     apache-2.0/src/modules/proxy/proxy_util.c
  
  Index: proxy_util.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/proxy/proxy_util.c,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- proxy_util.c	2000/11/17 00:19:30	1.27
  +++ proxy_util.c	2000/11/17 03:45:02	1.28
  @@ -1109,25 +1109,15 @@
   {
       apr_status_t rv;
       int i;
  +    apr_sockaddr_t *destsa;
   
  -    for (i = 0; host[i] != '\0'; i++)
  -        if (!apr_isdigit(host[i]) && host[i] != '.')
  -            break;
  -
  -    apr_set_port(sock, APR_REMOTE, port);
  -    if (host[i] == '\0') {
  -        apr_set_ipaddr(sock, APR_REMOTE, host);
  -        host = NULL;
  +    rv = apr_getaddrinfo(&destsa, host, AF_INET, port, r->pool);
  +    if (rv == APR_SUCCESS) {
  +        rv = apr_connect(sock, destsa);
       }
  -
  -    do
  -    {
  -        rv = apr_connect(sock, host);
  -    } while (APR_STATUS_IS_EINTR(rv));
  -
       if (rv != APR_SUCCESS)
       {
  -        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
  +        ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
               "proxy connect to %s port %d failed", host, port);
       }
       return rv;
  
  
  
  1.33      +8 -6      apache-2.0/src/support/ab.c
  
  Index: ab.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/support/ab.c,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- ab.c	2000/11/10 19:01:33	1.32
  +++ ab.c	2000/11/17 03:45:02	1.33
  @@ -482,6 +482,7 @@
   static void start_connect(struct connection *c)
   {
       apr_status_t rv;
  +    apr_sockaddr_t *destsa;
   
       if(!(started < requests)) return;
   
  @@ -491,14 +492,15 @@
       c->cbx = 0;
       c->gotheader = 0;
   
  +    if ((rv = apr_getaddrinfo(&destsa, hostname, AF_INET, port, 0, cntxt))
  +         != APR_SUCCESS) {
  +        apr_err("apr_getaddrinfo()", rv);
  +    }
       if ((rv = apr_create_tcp_socket(&c->aprsock, cntxt)) != APR_SUCCESS) {
           apr_err("Socket:", rv);
       }
  -    if ((rv = apr_set_port(c->aprsock, APR_REMOTE, port)) != APR_SUCCESS) {
  -        apr_err("Port:", rv);
  -    }
       c->start = apr_now();
  -    if ((rv = apr_connect(c->aprsock, hostname)) != APR_SUCCESS) {
  +    if ((rv = apr_connect(c->aprsock, destsa)) != APR_SUCCESS) {
           if (APR_STATUS_IS_EINPROGRESS(rv)) {
               c->state = STATE_CONNECTING;
               apr_add_poll_socket(readbits, c->aprsock, APR_POLLOUT);
  @@ -876,14 +878,14 @@
   static void copyright(void)
   {
       if (!use_html) {
  -        printf("This is ApacheBench, Version %s\n", AB_VERSION " <$Revision: 1.32 $>
apache-2.0");
  +        printf("This is ApacheBench, Version %s\n", AB_VERSION " <$Revision: 1.33 $>
apache-2.0");
           printf("Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n");
           printf("Copyright (c) 1998-2000 The Apache Software Foundation, http://www.apache.org/\n");
           printf("\n");
       }
       else {
           printf("<p>\n");
  -        printf(" This is ApacheBench, Version %s <i>&lt;%s&gt;</i>
apache-2.0<br>\n", AB_VERSION, "$Revision: 1.32 $");
  +        printf(" This is ApacheBench, Version %s <i>&lt;%s&gt;</i>
apache-2.0<br>\n", AB_VERSION, "$Revision: 1.33 $");
           printf(" Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/<br>\n");
           printf(" Copyright (c) 1998-2000 The Apache Software Foundation, http://www.apache.org/<br>\n");
           printf("</p>\n<p>\n");
  
  
  
  1.12      +1 -0      apache-2.0/src/support/httpd.exp
  
  Index: httpd.exp
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/support/httpd.exp,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- httpd.exp	2000/11/16 22:08:40	1.11
  +++ httpd.exp	2000/11/17 03:45:02	1.12
  @@ -404,6 +404,7 @@
   apr_fprintf
   apr_full_read
   apr_full_write
  +apr_getaddrinfo
   apr_get_dir_filename
   apr_get_filedata
   apr_get_hostname
  
  
  
  1.42      +4 -19     apache-2.0/src/lib/apr/network_io/win32/sockets.c
  
  Index: sockets.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/win32/sockets.c,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- sockets.c	2000/11/16 17:31:25	1.41
  +++ sockets.c	2000/11/17 03:45:03	1.42
  @@ -258,9 +258,8 @@
       return APR_SUCCESS;
   }
   
  -apr_status_t apr_connect(apr_socket_t *sock, const char *hostname)
  +apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa)
   {
  -    struct hostent *hp;
       apr_status_t lasterror;
       fd_set temp;
   
  @@ -268,23 +267,8 @@
           return APR_ENOTSOCK;
       }
   
  -    if (hostname != NULL) {
  -        if (*hostname >= '0' && *hostname <= '9' && 
  -            strspn(hostname, "0123456789.") == strlen(hostname)) {
  -            sock->remote_addr->sa.sin.sin_addr.s_addr = inet_addr(hostname);
  -        }
  -        else {
  -            hp = gethostbyname(hostname);
  -            if (!hp)  {
  -                return apr_get_netos_error();
  -            }
  -            memcpy((char *)&sock->remote_addr->sa.sin.sin_addr, hp->h_addr_list[0],

  -                   hp->h_length);
  -        }
  -    }
  -    
  -    if (connect(sock->sock, (const struct sockaddr *)&sock->remote_addr->sa.sin,
  -                sock->remote_addr->sa_len) == SOCKET_ERROR) {
  +    if (connect(sock->sock, (const struct sockaddr *)&sa->sa.sin,
  +                sa->sa_len) == SOCKET_ERROR) {
           lasterror = apr_get_netos_error();
           if (lasterror != APR_FROM_OS_ERROR(WSAEWOULDBLOCK)) {
               return lasterror;
  @@ -297,6 +281,7 @@
           }
       }
       /* connect was OK .. amazing */
  +    sock->remote_addr = sa;
       if (sock->local_addr->sa.sin.sin_port == 0) {
           sock->local_port_unknown = 1;
       }
  
  
  
  1.32      +4 -22     apache-2.0/src/lib/apr/network_io/os2/sockets.c
  
  Index: sockets.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/os2/sockets.c,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- sockets.c	2000/11/17 02:52:34	1.31
  +++ sockets.c	2000/11/17 03:45:03	1.32
  @@ -228,29 +228,10 @@
       return APR_SUCCESS;
   }
   
  -apr_status_t apr_connect(apr_socket_t *sock, const char *hostname)
  +apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa)
   {
  -    struct hostent *hp;
  -
  -    if (hostname != NULL) {
  -        hp = gethostbyname(hostname);
  -
  -        if ((sock->socketdes < 0) || (!sock->remote_addr)) {
  -            return APR_ENOTSOCK;
  -        }
  -        if (!hp)  {
  -            if (h_errno == TRY_AGAIN) {
  -                return EAGAIN;
  -            }
  -            return h_errno;
  -        }
  -    
  -        memcpy((char *)&sock->remote_addr->sa.sin.sin_addr, hp->h_addr_list[0],

  -               hp->h_length);
  -    }
  -
  -    if ((connect(sock->socketdes, (struct sockaddr *)&sock->remote_addr->sa.sin,

  -                 sock->remote_addr->sa_len) < 0) &&
  +    if ((connect(sock->socketdes, (struct sockaddr *)&sa->sa.sin, 
  +                 sa->sa_len) < 0) &&
           (sock_errno() != SOCEINPROGRESS)) {
           return APR_OS2_STATUS(sock_errno());
       }
  @@ -258,6 +239,7 @@
           int namelen = sizeof(sock->local_addr->sa.sin);
           getsockname(sock->socketdes, (struct sockaddr *)&sock->local_addr->sa.sin,

                       &namelen);
  +        sock->remote_addr = sa;
           return APR_SUCCESS;
       }
   }
  
  
  
  1.42      +2 -0      apache-2.0/src/lib/apr/aprlib.def
  
  Index: aprlib.def
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/aprlib.def,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- aprlib.def	2000/11/10 20:26:39	1.41
  +++ aprlib.def	2000/11/17 03:45:03	1.42
  @@ -51,6 +51,8 @@
   
   ;
   ; apr_network_io.h
  +        apr_getaddrinfo         @45
  +        apr_create_socket       @46
   	apr_create_tcp_socket   @47
   	apr_shutdown   @48
   	apr_close_socket   @49
  
  
  
  1.335     +5 -0      apache-2.0/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/CHANGES,v
  retrieving revision 1.334
  retrieving revision 1.335
  diff -u -r1.334 -r1.335
  --- CHANGES	2000/11/17 00:19:29	1.334
  +++ CHANGES	2000/11/17 03:45:03	1.335
  @@ -1,4 +1,9 @@
   Changes with Apache 2.0a8
  +  *) APR: Change apr_connect() to take apr_sockaddr_t instead of hostname.
  +     Add generic apr_create_socket().  Add apr_getaddrinfo() for doing
  +     hostname resolution/address string parsing and building
  +     apr_sockaddr_t.  [David Reid and Jeff Trawick]
  +
     *) Remove the BUFF from the HTTP proxy.  This is still a bit ugly, but
        I have proxied pages with it, cleanup will commence soon.
        [Ryan Bloom]
  
  
  

Mime
View raw message