Hi,

I'm timing out on this one, but I thought I'd throw it in here in
case someone has a bright idea on what is actually going on...

First it doesn't seem to be the case that mod_proxy actually
sets r->status in the case of an error (service temporarily
unavailable caused by ProxyTimeout for instance).  This may
not matter for a handler, but...

Secondly in case we hit the cleanup phase (for example when
we hit an error like above), mod_proxy doesn't allow filters
that were set up a chance to run.

Hereby a tiny patch to fix these issues, though I'd like some
feedback whether this is the correct spot to do this in mod_proxy.

Thanks,

Sander

Index: modules/proxy/mod_proxy.c
===================================================================
--- modules/proxy/mod_proxy.c   (revision 359556)
+++ modules/proxy/mod_proxy.c   (working copy)
@@ -790,6 +790,18 @@

    proxy_run_request_status(&access_status, r);

+    if (!r->eos_sent) {
+        apr_bucket_brigade *bb;
+        apr_bucket *e;
+
+        r->status = access_status;
+
+        bb = apr_brigade_create(r->pool, r->connection->bucket_alloc);
+        e = apr_bucket_eos_create(bb->bucket_alloc);
+        APR_BRIGADE_INSERT_TAIL(bb, e);
+        ap_pass_brigade(r->output_filters, bb);
+    }
+
    return access_status;
}

Reply via email to