stoddard    00/01/25 21:01:19

  Modified:    src/os/unix iol_socket.c
               src/lib/apr/network_io/unix sendrecv.c
  Log:
  Fix a couple of bugs in the Unix side of the house. Not tested (no machine 
available).
  First bug: Use ap_sendv to implement iol_writev. The previous implementation 
would
  only send the first buffer in the chain.
  
  Second bug: ap_sendfile() on HP needs to put all the headers (trailers) into 
a single
  header (trailer) buffer. The data was not being copied into the buffers 
correctly.
  
  Revision  Changes    Path
  1.14      +1 -2      apache-2.0/src/os/unix/iol_socket.c
  
  Index: iol_socket.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/os/unix/iol_socket.c,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- iol_socket.c      2000/01/19 01:16:21     1.13
  +++ iol_socket.c      2000/01/26 05:01:13     1.14
  @@ -109,8 +109,7 @@
   static ap_status_t unix_writev(ap_iol *viol, const struct iovec *vec, int 
nvec,
       ap_ssize_t *nbytes)
   {
  -    *nbytes = vec[0].iov_len;
  -    return ap_send(((iol_socket *)viol)->sock, vec[0].iov_base, nbytes);
  +    return ap_sendv(((iol_socket *)viol)->sock, vec, nvec, nbytes);
   }
   
   static ap_status_t unix_read(ap_iol *viol, char* buf, ap_size_t size,
  
  
  
  1.9       +2 -2      apache-2.0/src/lib/apr/network_io/unix/sendrecv.c
  
  Index: sendrecv.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/unix/sendrecv.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- sendrecv.c        1999/12/04 21:48:34     1.8
  +++ sendrecv.c        2000/01/26 05:01:16     1.9
  @@ -465,7 +465,7 @@
       headerbuf = ap_palloc(sock->cntxt, headerlen);
   
       for (i = 0; i < hdtr->numheaders; i++) {
  -        memcpy(headerbuf, hdtr->headers[i].iov_base + ptr,
  +        memcpy(headerbuf + ptr, hdtr->headers[i].iov_base,
                  hdtr->headers[i].iov_len);
           ptr += hdtr->headers[i].iov_len;
       }
  @@ -477,7 +477,7 @@
       trailerbuf = ap_palloc(sock->cntxt, trailerlen);
   
       for (i = 0; i < hdtr->numtrailers; i++) {
  -        memcpy(trailerbuf, hdtr->trailers[i].iov_base + ptr,
  +        memcpy(trailerbuf + ptr, hdtr->trailers[i].iov_base,
                  hdtr->trailers[i].iov_len);
           ptr += hdtr->trailers[i].iov_len;
       }
  
  
  

Reply via email to