apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@locus.apache.org
Subject cvs commit: apr/test sendfile.c
Date Thu, 28 Dec 2000 23:03:37 GMT
rbb         00/12/28 15:03:35

  Modified:    network_io/unix sendrecv.c
               test     sendfile.c
  Log:
  We do not want to return EAGAIN if there is a timeout set on the socket.
  
  Revision  Changes    Path
  1.53      +3 -3      apr/network_io/unix/sendrecv.c
  
  Index: sendrecv.c
  ===================================================================
  RCS file: /home/cvs/apr/network_io/unix/sendrecv.c,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- sendrecv.c	2000/12/22 00:19:16	1.52
  +++ sendrecv.c	2000/12/28 23:03:28	1.53
  @@ -385,7 +385,7 @@
           		apr_hdtr_t * hdtr, apr_off_t * offset, apr_size_t * len,
           		apr_int32_t flags)
   {
  -    off_t nbytes;
  +    off_t nbytes = 0;
       int rv, i;
       struct sf_hdtr headerstruct;
       size_t bytes_to_send = *len;
  @@ -412,7 +412,7 @@
       headerstruct.trl_cnt = hdtr->numtrailers;
   
       /* FreeBSD can send the headers/footers as part of the system call */
  -    if (sock->timeout > 0) {
  +    if (sock->timeout >= 0) {
           /* On FreeBSD, it is possible for the first call to sendfile to
            * get EAGAIN, but still send some data.  This means that we cannot
            * call sendfile and then check for EAGAIN, and then wait and call
  @@ -459,7 +459,7 @@
       } while (rv == -1 && errno == EINTR);
   
       (*len) = nbytes;
  -    if (rv == -1) {
  +    if (rv == -1 && (errno != EAGAIN || (errno == EAGAIN && sock->timeout
< 0))) {
           return errno;
       }
       return APR_SUCCESS;
  
  
  
  1.4       +1 -1      apr/test/sendfile.c
  
  Index: sendfile.c
  ===================================================================
  RCS file: /home/cvs/apr/test/sendfile.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- sendfile.c	2000/12/21 20:08:35	1.3
  +++ sendfile.c	2000/12/28 23:03:33	1.4
  @@ -434,7 +434,7 @@
   
           } while (total_bytes_sent < expected_len &&
                    (rv == APR_SUCCESS || 
  -                  APR_STATUS_IS_EAGAIN(rv)));
  +                 (APR_STATUS_IS_EAGAIN(rv) && socket_mode != TIMEOUT)));
           if (total_bytes_sent != expected_len) {
               fprintf(stderr,
                       "client problem: sent %ld of %ld bytes\n",
  
  
  

Mime
View raw message