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 Mon, 19 Feb 2001 18:00:53 GMT
trawick     01/02/19 10:00:52

  Modified:    network_io/unix sendrecv.c
  Log:
  apr_sendfile() for HP-UX: handle the unexpected case where the caller
  gives us header bytes to send but no file bytes to send; better to just
  let it work than to fail the call
  
  Submitted by: Greg Stein
  
  Revision  Changes    Path
  1.59      +4 -4      apr/network_io/unix/sendrecv.c
  
  Index: sendrecv.c
  ===================================================================
  RCS file: /home/cvs/apr/network_io/unix/sendrecv.c,v
  retrieving revision 1.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- sendrecv.c	2001/02/16 21:34:05	1.58
  +++ sendrecv.c	2001/02/19 18:00:50	1.59
  @@ -564,8 +564,8 @@
                             hdtrarray,            /* Headers/footers */
                             flags);               /* undefined, set to 0 */
           }
  -        else {              /* we can't call sendfile() for trailers only */
  -            rc = write(sock->socketdes, hdtrarray[1].iov_base, hdtrarray[1].iov_len);
  +        else {              /* we can't call sendfile() with no bytes to send from the
file */
  +            rc = writev(sock->socketdes, hdtrarray, 2);
           }
       } while (rc == -1 && errno == EINTR);
   
  @@ -588,8 +588,8 @@
                                     hdtrarray,          /* Headers/footers */
                                     flags);             /* undefined, set to 0 */
                   }
  -                else {      /* we can't call sendfile() for trailers only */
  -                    rc = write(sock->socketdes, hdtrarray[1].iov_base, hdtrarray[1].iov_len);
  +                else {      /* we can't call sendfile() with no bytes to send from the
file */
  +                    rc = writev(sock->socketdes, hdtrarray, 2);
                   }
               } while (rc == -1 && errno == EINTR);
           }
  
  
  

Mime
View raw message