]> granicus.if.org Git - apache/commitdiff
Realign the cache_quick_handler() and cache_handler() to behave identically
authorGraham Leggett <minfrin@apache.org>
Sat, 2 Oct 2010 23:17:47 +0000 (23:17 +0000)
committerGraham Leggett <minfrin@apache.org>
Sat, 2 Oct 2010 23:17:47 +0000 (23:17 +0000)
to the default_handler() when it comes to reacting to errors when writing
to the filter stack. Previously the error message implied the cache had
failed, when in reality, any part of the filter stack may have returned an
error.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1003913 13f79535-47bb-0310-9956-ffa450edef68

modules/cache/mod_cache.c

index d0e915d50cb78ab9734d7b3ed98e3517cb94bf8a..460887e89568faca0d36172bc930af304d441ce8 100644 (file)
@@ -275,10 +275,11 @@ static int cache_quick_handler(request_rec *r, int lookup)
     rv = ap_pass_brigade(r->output_filters, out);
     if (rv != APR_SUCCESS) {
         if (rv != AP_FILTER_ERROR) {
-            ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server,
-                         "cache: error returned while trying to return %s "
-                         "cached data",
-                         cache->provider_name);
+            /* no way to know what type of error occurred */
+            ap_log_rerror(APLOG_MARK, APLOG_DEBUG, rv, r,
+                          "cache_quick_handler(%s): ap_pass_brigade returned %i",
+                          cache->provider_name, rv);
+            return HTTP_INTERNAL_SERVER_ERROR;
         }
         return rv;
     }
@@ -518,10 +519,11 @@ static int cache_handler(request_rec *r)
     rv = ap_pass_brigade(r->output_filters, out);
     if (rv != APR_SUCCESS) {
         if (rv != AP_FILTER_ERROR) {
-            ap_log_error(APLOG_MARK, APLOG_ERR, rv, r->server,
-                         "cache: error returned while trying to return %s "
-                         "cached data",
-                         cache->provider_name);
+            /* no way to know what type of error occurred */
+            ap_log_rerror(APLOG_MARK, APLOG_DEBUG, rv, r,
+                          "cache_handler(%s): ap_pass_brigade returned %i",
+                          cache->provider_name, rv);
+            return HTTP_INTERNAL_SERVER_ERROR;
         }
         return rv;
     }