mirror of
https://github.com/apache/httpd.git
synced 2025-08-08 15:02:10 +03:00
Add ap_proxy_pre_request API function.
It calls the actual module pre_request hook if present Submitted by: mturk git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104578 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -1192,6 +1192,47 @@ ap_proxy_add_worker_to_balancer(struct proxy_balancer *balancer, proxy_worker *w
|
||||
|
||||
}
|
||||
|
||||
PROXY_DECLARE(int) ap_proxy_pre_request(proxy_worker **worker,
|
||||
struct proxy_balancer **balancer,
|
||||
request_rec *r,
|
||||
proxy_server_conf *conf, char **url)
|
||||
{
|
||||
int access_status;
|
||||
|
||||
access_status = proxy_run_pre_request(worker, balancer, r, conf, url);
|
||||
if (access_status == DECLINED && *balancer == NULL) {
|
||||
*worker = ap_proxy_get_worker(r->pool, conf, *url);
|
||||
if (*worker) {
|
||||
*balancer = NULL;
|
||||
access_status = OK;
|
||||
}
|
||||
else
|
||||
access_status = DECLINED;
|
||||
}
|
||||
else if (access_status == DECLINED && balancer != NULL) {
|
||||
/* All the workers are busy */
|
||||
access_status = HTTP_SERVICE_UNAVAILABLE;
|
||||
}
|
||||
return access_status;
|
||||
}
|
||||
|
||||
PROXY_DECLARE(int) ap_proxy_post_request(proxy_worker *worker,
|
||||
struct proxy_balancer *balancer,
|
||||
request_rec *r,
|
||||
proxy_server_conf *conf)
|
||||
{
|
||||
int access_status;
|
||||
if (balancer)
|
||||
access_status = proxy_run_post_request(worker, balancer, r, conf);
|
||||
else {
|
||||
|
||||
|
||||
access_status = OK;
|
||||
}
|
||||
|
||||
return access_status;
|
||||
}
|
||||
|
||||
PROXY_DECLARE(int) ap_proxy_connect_to_backend(apr_socket_t **newsock,
|
||||
const char *proxy_function,
|
||||
apr_sockaddr_t *backend_addr,
|
||||
|
Reference in New Issue
Block a user