summaryrefslogtreecommitdiffstats
path: root/modules/proxy/mod_proxy.h
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2021-09-24 13:25:42 +0200
committerYann Ylavic <ylavic@apache.org>2021-09-24 13:25:42 +0200
commitb44b9b6b2a4af4cd89b80190df85f67d57ecd43b (patch)
tree8f189ac55d6c00c28a5c6c02748455a974c81c58 /modules/proxy/mod_proxy.h
parentmod_proxy: Restore ap_proxy_transfer_between_connections(). (diff)
downloadapache2-b44b9b6b2a4af4cd89b80190df85f67d57ecd43b.tar.xz
apache2-b44b9b6b2a4af4cd89b80190df85f67d57ecd43b.zip
mod_proxy: Handle ap_proxy_buckets_lifetime_transform() errors.
* modules/proxy/mod_proxy.h,modules/proxy/proxy_util.c: Add ap_proxy_fill_error_brigade() to factorize proxy error handling on the client connection side. * modules/proxy/mod_proxy_{http,ajp,uwsgi}.c: Use ap_proxy_fill_error_brigade() where needed, including when an empty brigade is returned on the backend side or when calling ap_proxy_buckets_lifetime_transform fails. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1893595 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/proxy/mod_proxy.h')
-rw-r--r--modules/proxy/mod_proxy.h25
1 files changed, 20 insertions, 5 deletions
diff --git a/modules/proxy/mod_proxy.h b/modules/proxy/mod_proxy.h
index 76bf74c676..646d9795fd 100644
--- a/modules/proxy/mod_proxy.h
+++ b/modules/proxy/mod_proxy.h
@@ -1177,12 +1177,27 @@ PROXY_DECLARE(int) ap_proxy_connection_create_ex(const char *proxy_function,
PROXY_DECLARE(int) ap_proxy_connection_reusable(proxy_conn_rec *conn);
/**
- * Signal the upstream chain that the connection to the backend broke in the
- * middle of the response. This is done by sending an error bucket with
- * status HTTP_BAD_GATEWAY and an EOS bucket up the filter chain.
+ * Fill a brigade that can be sent downstream to signal that the connection to
+ * the backend broke in the middle of the response. The brigade will contain
+ * an error bucket with the given status and eventually an EOC bucket if asked
+ * to or heuristically if the response header was sent already.
* @param r current request record of client request
- * @param brigade The brigade that is sent through the output filter chain
- * @deprecated To be removed in v2.6.
+ * @param status the error status
+ * @param bb the brigade to fill
+ * @param eoc 0 do not add an EOC bucket, > 0 always add one, < 0 add one
+ * only if the response header was sent already
+ */
+PROXY_DECLARE(void) ap_proxy_fill_error_brigade(request_rec *r, int status,
+ apr_bucket_brigade *bb,
+ int eoc);
+
+/**
+ * Fill a brigade that can be sent downstream to signal that the connection to
+ * the backend broke in the middle of the response. The brigade will contain
+ * an error bucket with status HTTP_BAD_GATEWAY and an EOS bucket.
+ * @param r current request record of client request
+ * @param brigade the brigade to fill
+ * @deprecated To be removed in v2.6 (see ap_proxy_fill_error_brigade).
*/
PROXY_DECLARE(void) ap_proxy_backend_broke(request_rec *r,
apr_bucket_brigade *brigade);