You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by br...@apache.org on 2002/04/15 08:09:11 UTC

cvs commit: apr/network_io/unix sockets.c

brianp      02/04/14 23:09:11

  Modified:    network_io/unix sockets.c
  Log:
  On platforms where the nonblocking flag on a listener socket is
  inherited upon accept, set the APR_SO_NONBLOCK flag in the newly
  accepted connection.
  
  (The motivation for this, by the way, is Solaris 8, where
  putting a socket in nonblocking mode is expensive (fcntl(F_SETFL) on
  a socket does 4 syscalls internally) but the nonblocking flag is
  inherited across accept.)
  
  Revision  Changes    Path
  1.97      +5 -0      apr/network_io/unix/sockets.c
  
  Index: sockets.c
  ===================================================================
  RCS file: /home/cvs/apr/network_io/unix/sockets.c,v
  retrieving revision 1.96
  retrieving revision 1.97
  diff -u -r1.96 -r1.97
  --- sockets.c	1 Apr 2002 14:13:45 -0000	1.96
  +++ sockets.c	15 Apr 2002 06:09:10 -0000	1.97
  @@ -222,6 +222,11 @@
           apr_set_option(&(*new)->netmask, APR_TCP_NODELAY, 1);
       }
   #endif /* TCP_NODELAY_INHERITED */
  +#if APR_O_NONBLOCK_INHERITED
  +    if (apr_is_option_set(sock->netmask, APR_SO_NONBLOCK) == 1) {
  +        apr_set_option(&(*new)->netmask, APR_SO_NONBLOCK, 1);
  +    }
  +#endif /* APR_O_NONBLOCK_INHERITED */
   
       if (sock->local_interface_unknown ||
           !memcmp(sock->local_addr->ipaddr_ptr,