apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject svn commit: r190575 - in /apr/apr-util/branches/0.9.x: CHANGES buckets/apr_buckets_file.c
Date Tue, 14 Jun 2005 10:41:58 GMT
Author: jorton
Date: Tue Jun 14 03:41:57 2005
New Revision: 190575

URL: http://svn.apache.org/viewcvs?rev=190575&view=rev
Log:
Merge r179564 from trunk:

* buckets/apr_buckets_file.c (file_bucket_read): If an EOF was read,
the file must have been truncated; in this case, do not insert a new
FILE bucket, and do return APR_EOF to the caller.

PR: 34708
Submitted by: trawick, jorton

Modified:
    apr/apr-util/branches/0.9.x/CHANGES
    apr/apr-util/branches/0.9.x/buckets/apr_buckets_file.c

Modified: apr/apr-util/branches/0.9.x/CHANGES
URL: http://svn.apache.org/viewcvs/apr/apr-util/branches/0.9.x/CHANGES?rev=190575&r1=190574&r2=190575&view=diff
==============================================================================
--- apr/apr-util/branches/0.9.x/CHANGES (original)
+++ apr/apr-util/branches/0.9.x/CHANGES Tue Jun 14 03:41:57 2005
@@ -1,5 +1,9 @@
 Changes with APR-util 0.9.7
 
+  *) Fix handling of a premature EOF with the FILE bucket; a new bucket
+     is not inserted for each attempt to read past EOF.  PR 34708.
+     [Jeff Trawick, Joe Orton]
+
   *) Fix build failure with non-threaded APR on AIX.  PR 34655.
      [Ryan Murray <rmurray+apache cyberhqz.com>]
 

Modified: apr/apr-util/branches/0.9.x/buckets/apr_buckets_file.c
URL: http://svn.apache.org/viewcvs/apr/apr-util/branches/0.9.x/buckets/apr_buckets_file.c?rev=190575&r1=190574&r2=190575&view=diff
==============================================================================
--- apr/apr-util/branches/0.9.x/buckets/apr_buckets_file.c (original)
+++ apr/apr-util/branches/0.9.x/buckets/apr_buckets_file.c Tue Jun 14 03:41:57 2005
@@ -133,7 +133,7 @@
     apr_bucket_heap_make(e, buf, *len, apr_bucket_free);
 
     /* If we have more to read from the file, then create another bucket */
-    if (filelength > 0) {
+    if (filelength > 0 && rv != APR_EOF) {
         /* for efficiency, we can just build a new apr_bucket struct
          * to wrap around the existing file bucket */
         b = apr_bucket_alloc(sizeof(*b), e->list);
@@ -150,7 +150,7 @@
     }
 
     *str = buf;
-    return APR_SUCCESS;
+    return rv;
 }
 
 APU_DECLARE(apr_bucket *) apr_bucket_file_make(apr_bucket *b, apr_file_t *fd,



Mime
View raw message