httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@locus.apache.org
Subject cvs commit: apache-2.0/src/lib/apr/network_io/unix sendrecv.c
Date Tue, 18 Jul 2000 15:16:49 GMT
trawick     00/07/18 08:16:48

  Modified:    src/lib/apr/network_io/unix sendrecv.c
  Log:
  ap_sendfile() fix: If the caller passes NULL for the ap_hdtr_t *,
  set hdtr to the address of one that specifies no headers and trailers.
  This prevents accessing low core while keeping the following code
  simpler (no need to check hdtr != NULL later).
  
  Revision  Changes    Path
  1.36      +22 -0     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.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- sendrecv.c	2000/07/18 03:02:17	1.35
  +++ sendrecv.c	2000/07/18 15:16:46	1.36
  @@ -211,6 +211,8 @@
     *     - Should flags be an int_32 or what?
     */
   
  +static ap_hdtr_t no_hdtr; /* used below when caller passes NULL for ap_hdtr_t */
  +
   #if defined(__linux__) && defined(HAVE_WRITEV)
   
   /* TCP_CORK keeps us from sending partial frames when we shouldn't 
  @@ -266,6 +268,10 @@
       int rv, nbytes = 0, total_hdrbytes, i, delayflag = APR_EINIT, corked = 0;
       ap_status_t arv;
   
  +    if (!hdtr) {
  +        hdtr = &no_hdtr;
  +    }
  +
       /* Ignore flags for now. */
       flags = 0;
   
  @@ -394,6 +400,10 @@
       struct sf_hdtr headerstruct;
       size_t bytes_to_send = *len;
   
  +    if (!hdtr) {
  +        hdtr = &no_hdtr;
  +    }
  +
       /* Ignore flags for now. */
       flags = 0;
   
  @@ -484,6 +494,10 @@
       struct iovec hdtrarray[2];
       void *headerbuf, *trailerbuf;
   
  +    if (!hdtr) {
  +        hdtr = &no_hdtr;
  +    }
  +
       /* Ignore flags for now. */
       flags = 0;
   
  @@ -586,6 +600,10 @@
       ap_status_t arv;
       struct sf_parms parms;
   
  +    if (!hdtr) {
  +        hdtr = &no_hdtr;
  +    }
  +
       /* Ignore flags for now. */
       flags = 0;
   
  @@ -712,6 +730,10 @@
       struct iovec headerstruct[2] = {(0, 0), (0, 0)};
       size_t bytes_to_send = *len;
       
  +    if (!hdtr) {
  +        hdtr = &no_hdtr;
  +    }
  +
       /* Ignore flags for now. */
       flags = 0;
       
  
  
  

Mime
View raw message