Eyes please... The coffee is VERY week this morning :)

Index: modules/proxy/mod_proxy_http.c
===================================================================
--- modules/proxy/mod_proxy_http.c      (revision 356419)
+++ modules/proxy/mod_proxy_http.c      (working copy)
@@ -1481,12 +1481,19 @@
                     }
                     else if (rv != APR_SUCCESS) {
/* In this case, we are in real trouble because
-                         * our backend bailed on us, so abort our
-                         * connection to our user too.
+ * our backend bailed on us. Pass along a 502 error
+                         * bucket
                          */
                         ap_log_cerror(APLOG_MARK, APLOG_ERR, rv, c,
"proxy: error reading response");
-                        c->aborted = 1;
+                        r->no_cache = 1;
+ e = ap_bucket_error_create(HTTP_BAD_GATEWAY, NULL, + c->pool, c- >bucket_alloc);
+                        APR_BRIGADE_INSERT_TAIL(bb, e);
+                        e = apr_bucket_eos_create(f->c->bucket_alloc);
+                        APR_BRIGADE_INSERT_TAIL(bb, e);
+                        ap_pass_brigade(r->output_filters, bb);
+                        backend->close = 1;
                         break;
                     }
                     /* next time try a non-blocking read */
Index: modules/cache/mod_disk_cache.c
===================================================================
--- modules/cache/mod_disk_cache.c      (revision 356419)
+++ modules/cache/mod_disk_cache.c      (working copy)
@@ -1010,7 +1010,7 @@
      * sanity checks.
      */
     if (APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(bb))) {
-        if (r->connection->aborted) {
+        if (r->connection->aborted || r->no_cache) {
             ap_log_error(APLOG_MARK, APLOG_INFO, 0, r->server,
                          "disk_cache: Discarding body for URL %s "
                          "because connection has been aborted.",

Reply via email to