You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by pq...@apache.org on 2006/04/01 08:26:58 UTC

svn commit: r390598 - in /httpd/httpd/branches/2.2.x: CHANGES STATUS modules/cache/mod_disk_cache.c

Author: pquerna
Date: Fri Mar 31 22:26:56 2006
New Revision: 390598

URL: http://svn.apache.org/viewcvs?rev=390598&view=rev
Log:
Merge r389697 and r390499 from trunk, making mod_disk_cache return better error codes, instead of a silly APR_EGENERAL.

Modified:
    httpd/httpd/branches/2.2.x/CHANGES
    httpd/httpd/branches/2.2.x/STATUS
    httpd/httpd/branches/2.2.x/modules/cache/mod_disk_cache.c

Modified: httpd/httpd/branches/2.2.x/CHANGES
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.2.x/CHANGES?rev=390598&r1=390597&r2=390598&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.2.x/CHANGES [utf-8] Fri Mar 31 22:26:56 2006
@@ -14,6 +14,10 @@
      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]
 

Modified: httpd/httpd/branches/2.2.x/STATUS
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.2.x/STATUS?rev=390598&r1=390597&r2=390598&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/STATUS (original)
+++ httpd/httpd/branches/2.2.x/STATUS Fri Mar 31 22:26:56 2006
@@ -75,14 +75,6 @@
 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

Modified: httpd/httpd/branches/2.2.x/modules/cache/mod_disk_cache.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.2.x/modules/cache/mod_disk_cache.c?rev=390598&r1=390597&r2=390598&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/cache/mod_disk_cache.c (original)
+++ httpd/httpd/branches/2.2.x/modules/cache/mod_disk_cache.c Fri Mar 31 22:26:56 2006
@@ -984,7 +984,15 @@
     {
         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 @@
                          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) {