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