apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject cvs commit: apr-util/buckets apr_buckets_file.c
Date Mon, 22 Jan 2001 23:33:59 GMT
rbb         01/01/22 15:33:59

  Modified:    buckets  apr_buckets_file.c
  Log:
  Fix the file buckets.  We were creating the second file bucket with
  incredibly wrong parameters.  This should fix the byterange filter in Apache
  until we modify it to use the bucket_copy stuff.
  
  Revision  Changes    Path
  1.21      +4 -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.20
  retrieving revision 1.21
  diff -u -d -b -w -u -r1.20 -r1.21
  --- apr_buckets_file.c	2001/01/19 07:02:00	1.20
  +++ apr_buckets_file.c	2001/01/22 23:33:58	1.21
  @@ -94,6 +94,7 @@
       apr_bucket *b = NULL;
       char *buf;
       apr_status_t rv;
  +    apr_off_t length = e->length;
   #if APR_HAS_MMAP
       apr_mmap_t *mm = NULL;
   #endif
  @@ -145,6 +146,7 @@
   	    free(buf);
               return rv;
           }
  +        length -= *len;
   
           /*
            * Change the current bucket to refer to what we read,
  @@ -153,8 +155,8 @@
           apr_bucket_make_heap(e, buf, *len, 0, NULL); /*XXX: check for failure? */
   
           /* If we have more to read from the file, then create another bucket */
  -        if (*len > 0) {
  -            b = apr_bucket_create_file(f, 0, e->length);
  +        if (length > 0) {
  +            b = apr_bucket_create_file(f, (*len) + 1, length);
               APR_BUCKET_INSERT_AFTER(e, b);
           }
   #if APR_HAS_MMAP
  
  
  

Mime
View raw message