]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r389697 and r390499 from trunk, making mod_disk_cache return better error codes...
authorPaul Querna <pquerna@apache.org>
Sat, 1 Apr 2006 06:26:56 +0000 (06:26 +0000)
committerPaul Querna <pquerna@apache.org>
Sat, 1 Apr 2006 06:26:56 +0000 (06:26 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@390598 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
modules/cache/mod_disk_cache.c

diff --git a/CHANGES b/CHANGES
index d8d0ba6c6bfffc535c9a39327b06e58ea7507e89..bf62e8a24b9dc36daed0cc39be69dc3121b11e69 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -14,6 +14,10 @@ Changes with Apache 2.2.1
      made to ap_escape_html so we escape quotes.  Reported by JPCERT.
      [Mark Cox]
 
+  *) mod_disk_cache: Return the correct error codes from bucket read 
+     failures, instead of APR_EGENERAL.
+     [Brian Akins <brian.akins turner.com>]
+
   *) Add APR/APR-Util Compiled and Runtime Version numbers to the
      output of 'httpd -V'. [William Rowe]
 
diff --git a/STATUS b/STATUS
index 1d8b7061ffbc7fbe1aec0085ca8511066c5aba2f..d9b9d43bfc3a56a780a4441fd45c4df6594321b3 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -75,14 +75,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-   * mod_disk_cache: Return correct error codes, instead of APR_EGENERAL.
-      Trunk version of patch:
-         http://svn.apache.org/viewcvs?rev=389697&view=rev
-         http://svn.apache.org/viewcvs?rev=390499&view=rev
-      Backport version for 2.2.x of patch:
-         Trunk version of patch works
-     +1: rpluem, pquerna, rooneg
-
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
 
     * mod_dbd: When threaded, create a private pool in child_init
index 79ed6f14b4803340b3898d4b2b916f1d0f4c7530..bf3427927169df013d33bfef959f485d7425dc41 100644 (file)
@@ -984,7 +984,15 @@ static apr_status_t store_body(cache_handle_t *h, request_rec *r,
     {
         const char *str;
         apr_size_t length, written;
-        apr_bucket_read(e, &str, &length, APR_BLOCK_READ);
+        rv = apr_bucket_read(e, &str, &length, APR_BLOCK_READ);
+        if (rv != APR_SUCCESS) {
+            ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
+                         "cache_disk: Error when reading bucket for URL %s",
+                         h->cache_obj->key);
+            /* Remove the intermediate cache file and return non-APR_SUCCESS */
+            file_cache_errorcleanup(dobj, r);
+            return rv;
+        }
         rv = apr_file_write_full(dobj->tfd, str, length, &written);
         if (rv != APR_SUCCESS) {
             ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
@@ -992,7 +1000,7 @@ static apr_status_t store_body(cache_handle_t *h, request_rec *r,
                          h->cache_obj->key);
             /* Remove the intermediate cache file and return non-APR_SUCCESS */
             file_cache_errorcleanup(dobj, r);
-            return APR_EGENERAL;
+            return rv;
         }
         dobj->file_size += written;
         if (dobj->file_size > conf->maxfs) {