apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject cvs commit: apr/network_io/unix sendrecv.c
Date Thu, 25 Apr 2002 18:27:31 GMT
trawick     02/04/25 11:27:31

  Modified:    .        CHANGES
               network_io/unix sendrecv.c
  Log:
  Reduce the number of apr_sendfile calls on AIX and OS/390 by
  remembering when the kernel tells us the next one will block.
  
  Revision  Changes    Path
  1.267     +4 -0      apr/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apr/CHANGES,v
  retrieving revision 1.266
  retrieving revision 1.267
  diff -u -r1.266 -r1.267
  --- CHANGES	24 Apr 2002 21:39:23 -0000	1.266
  +++ CHANGES	25 Apr 2002 18:27:31 -0000	1.267
  @@ -1,5 +1,9 @@
   Changes with APR b1
   
  +  *) Reduce the number of apr_sendfile calls on AIX and OS/390 by
  +     remembering when the kernel tells us the next one will block.
  +     [Jeff Trawick]
  +
     *) Reduce the number of apr_sendfile calls on FreeBSD by remembering
        when the kernel tells us the next one will block.  [Greg Ames]
   
  
  
  
  1.82      +12 -0     apr/network_io/unix/sendrecv.c
  
  Index: sendrecv.c
  ===================================================================
  RCS file: /home/cvs/apr/network_io/unix/sendrecv.c,v
  retrieving revision 1.81
  retrieving revision 1.82
  diff -u -r1.81 -r1.82
  --- sendrecv.c	24 Apr 2002 21:39:24 -0000	1.81
  +++ sendrecv.c	25 Apr 2002 18:27:31 -0000	1.82
  @@ -752,6 +752,11 @@
   
       /* O.K. All set up now. Let's go to town */
   
  +    if (sock->netmask & APR_INCOMPLETE_WRITE) {
  +        sock->netmask &= ~APR_INCOMPLETE_WRITE;
  +        goto do_select;
  +    }
  +
       do {
           rv = send_file(&(sock->socketdes), /* socket */
                          &(parms),           /* all data */
  @@ -761,6 +766,7 @@
       if (rv == -1 &&
           (errno == EAGAIN || errno == EWOULDBLOCK) &&
           sock->timeout > 0) {
  +do_select:
           arv = apr_wait_for_io_or_timeout(sock, 0);
           if (arv != APR_SUCCESS) {
               *len = 0;
  @@ -786,6 +792,12 @@
       if (rv == -1) {
           return errno;
       }
  +
  +    if (sock->timeout &&
  +        (parms.bytes_sent < (parms.file_bytes + parms.header_length + parms.trailer_length)))
{
  +        sock->netmask |= APR_INCOMPLETE_WRITE;
  +    }
  +
       return APR_SUCCESS;
   }
   #elif defined(__osf__) && defined (__alpha)
  
  
  

Mime
View raw message