diff options
author | Graham Leggett <minfrin@apache.org> | 2011-12-02 23:42:39 +0100 |
---|---|---|
committer | Graham Leggett <minfrin@apache.org> | 2011-12-02 23:42:39 +0100 |
commit | 0182b1654f065b6770f41479aa2128be534e6d06 (patch) | |
tree | 06eb5c908555515a6b568fc87045a8a774e4a85a /modules/proxy/balancers/mod_lbmethod_bytraffic.c | |
parent | Add APLOGNO() macro for unique tags for every log message. (diff) | |
download | apache2-0182b1654f065b6770f41479aa2128be534e6d06.tar.xz apache2-0182b1654f065b6770f41479aa2128be534e6d06.zip |
mod_proxy: Make ap_proxy_retry_worker() into an optional function. Allows
mod_lbmethod_bybusyness, mod_lbmethod_byrequests, mod_lbmethod_bytraffic
and mod_lbmethod_heartbeat to be loaded without mod_proxy yet being present,
which happens when modules are loaded in alphabetical order.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1209754 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/proxy/balancers/mod_lbmethod_bytraffic.c')
-rw-r--r-- | modules/proxy/balancers/mod_lbmethod_bytraffic.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/modules/proxy/balancers/mod_lbmethod_bytraffic.c b/modules/proxy/balancers/mod_lbmethod_bytraffic.c index d91bec0c0d..ef15dee0d4 100644 --- a/modules/proxy/balancers/mod_lbmethod_bytraffic.c +++ b/modules/proxy/balancers/mod_lbmethod_bytraffic.c @@ -22,6 +22,9 @@ module AP_MODULE_DECLARE_DATA lbmethod_bytraffic_module; +static int (*ap_proxy_retry_worker_fn)(const char *proxy_function, + proxy_worker *worker, server_rec *s) = NULL; + /* * The idea behind the find_best_bytraffic scheduler is the following: * @@ -52,6 +55,15 @@ static proxy_worker *find_best_bytraffic(proxy_balancer *balancer, int checking_standby; int checked_standby; + if (!ap_proxy_retry_worker_fn) { + ap_proxy_retry_worker_fn = + APR_RETRIEVE_OPTIONAL_FN(ap_proxy_retry_worker); + if (!ap_proxy_retry_worker_fn) { + /* can only happen if mod_proxy isn't loaded */ + return NULL; + } + } + ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy: Entering bytraffic for BALANCER (%s)", balancer->s->name); @@ -81,7 +93,7 @@ static proxy_worker *find_best_bytraffic(proxy_balancer *balancer, * anyway. */ if (!PROXY_WORKER_IS_USABLE(*worker)) - ap_proxy_retry_worker("BALANCER", *worker, r->server); + ap_proxy_retry_worker_fn("BALANCER", *worker, r->server); /* Take into calculation only the workers that are * not in error state or not disabled. */ |