httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@covalent.net
Subject cvs commit: apr-util/buckets apr_buckets_file.c (fwd)
Date Fri, 16 Feb 2001 17:44:19 GMT

This was just committed to apr_util's bucket code.  This should fix the
mod_include problem (at least it did for me).  What was happening, was
that we read from the file, and converted it into a heap bucket.  Then, we
destroyed the file bucket (free'ing *s at the same time), and then we used
s->start to create the second file bucket.  Obviously, this means we were
using garbage to create the second file_bucket.  This should allow us to
read from the files cleanly.

The second problem is one I haven't fixed however.  Brian, if you increase
the size of your file to 10Meg, then mod_include will read all 10Meg into
memory before sending it down the stack.  That's BAD!  mod_include needs
to be taught how to stream data when there are no SSI tags in the file.

I will be adding the second issue to STATUS.  Brian, please test the
latest code on OS/2.

Thanks.

Ryan

rbb         01/02/16 09:37:59

  Modified:    buckets  apr_buckets_file.c
  Log:
  We can't destroy the file_bucket until we have created the next
  file_bucket.  This was causing the second file_bucket to have invalid
  data in the shared_bucket, which caused us to read data from the
  file incorrectly.
  
  Revision  Changes    Path
  1.31      +2 -2      apr-util/buckets/apr_buckets_file.c
  
  Index: apr_buckets_file.c
  ===================================================================
  RCS file: /home/cvs/apr-util/buckets/apr_buckets_file.c,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -d -b -w -u -r1.30 -r1.31
  --- apr_buckets_file.c	2001/02/16 04:17:07	1.30
  +++ apr_buckets_file.c	2001/02/16 17:37:57	1.31
  @@ -164,13 +164,13 @@
            * even if we read nothing because we hit EOF.
            */
           apr_bucket_heap_make(e, buf, *len, 0, NULL); /*XXX: check for failure? */
  -        file_destroy(s);
  -
           /* If we have more to read from the file, then create another bucket */
           if (length > 0) {
               b = apr_bucket_file_create(f, s->start + (*len), length);
               APR_BUCKET_INSERT_AFTER(e, b);
           }
  +        file_destroy(s);
  +
   #if APR_HAS_MMAP
       }
   #endif
  
  
  



Mime
View raw message