1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-08 15:02:10 +03:00

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
This commit is contained in:
Yann Ylavic
2021-09-24 11:25:42 +00:00
parent 074d55133a
commit b44b9b6b2a
7 changed files with 138 additions and 66 deletions

View File

@@ -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);