httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dgau...@locus.apache.org
Subject cvs commit: apache-2.0/src/lib/apr/network_io/unix sockets.c sockopt.c
Date Sat, 10 Jun 2000 02:02:47 GMT
dgaudet     00/06/09 19:02:46

  Modified:    src/lib/apr/network_io/unix sockets.c sockopt.c
  Log:
  - don't call fcntl more than once for the socket
  - accepted socket timeouts start at -1 just like sockets created by other
    means
  
  Revision  Changes    Path
  1.46      +1 -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.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- sockets.c	2000/05/23 05:49:27	1.45
  +++ sockets.c	2000/06/10 02:02:44	1.46
  @@ -154,6 +154,7 @@
   #ifndef HAVE_POLL
       (*new)->connected = 1;
   #endif
  +    (*new)->timeout = -1;
   
       (*new)->socketdes = accept(sock->socketdes, (struct sockaddr *)(*new)->remote_addr,
                           &(*new)->addr_len);
  
  
  
  1.26      +8 -2      apache-2.0/src/lib/apr/network_io/unix/sockopt.c
  
  Index: sockopt.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/unix/sockopt.c,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- sockopt.c	2000/05/16 20:35:39	1.25
  +++ sockopt.c	2000/06/10 02:02:45	1.26
  @@ -155,10 +155,16 @@
           }
       }
       if (opt & APR_SO_TIMEOUT) {
  -        sock->timeout = on;
  -        if ((stat = sononblock(sock->socketdes)) != APR_SUCCESS) {
  +	/* don't do the fcntl foo more than needed */
  +	if (on >= 0 && sock->timeout < 0
  +		&& (stat = sononblock(sock->socketdes)) != APR_SUCCESS) {
               return stat;
           }
  +	else if (on < 0 && sock->timeout >= 0
  +		&& (stat = soblock(sock->socketdes)) != APR_SUCCESS) {
  +	    return stat;
  +	}
  +        sock->timeout = on;
       }
       return APR_SUCCESS;
   }         
  
  
  

Mime
View raw message