httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@hyperreal.org
Subject cvs commit: apache-2.0/src/lib/apr/network_io/unix sockets.c
Date Sun, 07 Nov 1999 07:35:43 GMT
manoj       99/11/06 23:35:43

  Modified:    src/lib/apr/network_io/unix sockets.c
  Log:
  ap_put_os_sock needs to do a lot of preparation of an ap_socket_t for it
  to be usable. This patch adds it.
  
  Revision  Changes    Path
  1.24      +14 -0     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.23
  retrieving revision 1.24
  diff -u -d -u -r1.23 -r1.24
  --- sockets.c	1999/11/02 21:49:26	1.23
  +++ sockets.c	1999/11/07 07:35:42	1.24
  @@ -335,6 +335,20 @@
       if ((*sock) == NULL) {
           (*sock) = (struct socket_t *)ap_palloc(cont, sizeof(struct socket_t));
           (*sock)->cntxt = cont;
  +        (*sock)->local_addr = (struct sockaddr_in *)ap_palloc((*sock)->cntxt,
  +                             sizeof(struct sockaddr_in));
  +        (*sock)->remote_addr = (struct sockaddr_in *)ap_palloc((*sock)->cntxt,
  +                              sizeof(struct sockaddr_in));
  +
  +        if ((*sock)->local_addr == NULL || (*sock)->remote_addr == NULL) {
  +            return APR_ENOMEM;
  +        }
  +     
  +        (*sock)->addr_len = sizeof(*(*sock)->local_addr);
  +        (*sock)->timeout = -1;
  +        if (getsockname(*thesock, (*sock)->local_addr, &((*sock)->addr_len))
< 0) {
  +            return errno;
  +        }
       }
       (*sock)->socketdes = *thesock;
       return APR_SUCCESS;
  
  
  

Mime
View raw message