mirror of
https://github.com/apache/httpd.git
synced 2025-08-08 15:02:10 +03:00
* ap_proxy_balancer_get_best_worker cannot be exported and used as an optional
function at the same time. So rename ap_proxy_balancer_get_best_worker to proxy_balancer_get_best_worker and make it static which is then used as an optional function and recreate ap_proxy_balancer_get_best_worker as an exported thin wrapper of proxy_balancer_get_best_worker. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1836603 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
module AP_MODULE_DECLARE_DATA lbmethod_bybusyness_module;
|
module AP_MODULE_DECLARE_DATA lbmethod_bybusyness_module;
|
||||||
|
|
||||||
static APR_OPTIONAL_FN_TYPE(ap_proxy_balancer_get_best_worker)
|
static APR_OPTIONAL_FN_TYPE(proxy_balancer_get_best_worker)
|
||||||
*ap_proxy_balancer_get_best_worker_fn = NULL;
|
*ap_proxy_balancer_get_best_worker_fn = NULL;
|
||||||
|
|
||||||
static int is_best_bybusyness(proxy_worker *current, proxy_worker *prev_best, void *baton)
|
static int is_best_bybusyness(proxy_worker *current, proxy_worker *prev_best, void *baton)
|
||||||
@@ -97,7 +97,7 @@ static int lbmethod_bybusyness_post_config(apr_pool_t *pconf, apr_pool_t *plog,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ap_proxy_balancer_get_best_worker_fn =
|
ap_proxy_balancer_get_best_worker_fn =
|
||||||
APR_RETRIEVE_OPTIONAL_FN(ap_proxy_balancer_get_best_worker);
|
APR_RETRIEVE_OPTIONAL_FN(proxy_balancer_get_best_worker);
|
||||||
if (!ap_proxy_balancer_get_best_worker_fn) {
|
if (!ap_proxy_balancer_get_best_worker_fn) {
|
||||||
ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(10151)
|
ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(10151)
|
||||||
"mod_proxy must be loaded for mod_lbmethod_bybusyness");
|
"mod_proxy must be loaded for mod_lbmethod_bybusyness");
|
||||||
|
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
module AP_MODULE_DECLARE_DATA lbmethod_byrequests_module;
|
module AP_MODULE_DECLARE_DATA lbmethod_byrequests_module;
|
||||||
|
|
||||||
static APR_OPTIONAL_FN_TYPE(ap_proxy_balancer_get_best_worker)
|
static APR_OPTIONAL_FN_TYPE(proxy_balancer_get_best_worker)
|
||||||
*ap_proxy_balancer_get_best_worker_fn = NULL;
|
*ap_proxy_balancer_get_best_worker_fn = NULL;
|
||||||
|
|
||||||
static int is_best_byrequests(proxy_worker *current, proxy_worker *prev_best, void *baton)
|
static int is_best_byrequests(proxy_worker *current, proxy_worker *prev_best, void *baton)
|
||||||
@@ -138,7 +138,7 @@ static int lbmethod_byrequests_post_config(apr_pool_t *pconf, apr_pool_t *plog,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ap_proxy_balancer_get_best_worker_fn =
|
ap_proxy_balancer_get_best_worker_fn =
|
||||||
APR_RETRIEVE_OPTIONAL_FN(ap_proxy_balancer_get_best_worker);
|
APR_RETRIEVE_OPTIONAL_FN(proxy_balancer_get_best_worker);
|
||||||
if (!ap_proxy_balancer_get_best_worker_fn) {
|
if (!ap_proxy_balancer_get_best_worker_fn) {
|
||||||
ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(10152)
|
ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(10152)
|
||||||
"mod_proxy must be loaded for mod_lbmethod_byrequests");
|
"mod_proxy must be loaded for mod_lbmethod_byrequests");
|
||||||
|
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
module AP_MODULE_DECLARE_DATA lbmethod_bytraffic_module;
|
module AP_MODULE_DECLARE_DATA lbmethod_bytraffic_module;
|
||||||
|
|
||||||
static APR_OPTIONAL_FN_TYPE(ap_proxy_balancer_get_best_worker)
|
static APR_OPTIONAL_FN_TYPE(proxy_balancer_get_best_worker)
|
||||||
*ap_proxy_balancer_get_best_worker_fn = NULL;
|
*ap_proxy_balancer_get_best_worker_fn = NULL;
|
||||||
|
|
||||||
static int is_best_bytraffic(proxy_worker *current, proxy_worker *prev_best, void *baton)
|
static int is_best_bytraffic(proxy_worker *current, proxy_worker *prev_best, void *baton)
|
||||||
@@ -108,7 +108,7 @@ static int lbmethod_bytraffic_post_config(apr_pool_t *pconf, apr_pool_t *plog,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ap_proxy_balancer_get_best_worker_fn =
|
ap_proxy_balancer_get_best_worker_fn =
|
||||||
APR_RETRIEVE_OPTIONAL_FN(ap_proxy_balancer_get_best_worker);
|
APR_RETRIEVE_OPTIONAL_FN(proxy_balancer_get_best_worker);
|
||||||
if (!ap_proxy_balancer_get_best_worker_fn) {
|
if (!ap_proxy_balancer_get_best_worker_fn) {
|
||||||
ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(10150)
|
ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(10150)
|
||||||
"mod_proxy must be loaded for mod_lbmethod_bytraffic");
|
"mod_proxy must be loaded for mod_lbmethod_bytraffic");
|
||||||
|
@@ -883,7 +883,7 @@ PROXY_DECLARE(proxy_worker *) ap_proxy_balancer_get_best_worker(proxy_balancer *
|
|||||||
/*
|
/*
|
||||||
* Needed by the lb modules.
|
* Needed by the lb modules.
|
||||||
*/
|
*/
|
||||||
APR_DECLARE_OPTIONAL_FN(proxy_worker *, ap_proxy_balancer_get_best_worker,
|
APR_DECLARE_OPTIONAL_FN(proxy_worker *, proxy_balancer_get_best_worker,
|
||||||
(proxy_balancer *balancer,
|
(proxy_balancer *balancer,
|
||||||
request_rec *r,
|
request_rec *r,
|
||||||
proxy_is_best_callback_fn_t *is_best,
|
proxy_is_best_callback_fn_t *is_best,
|
||||||
|
@@ -69,6 +69,10 @@ static int proxy_match_domainname(struct dirconn_entry *This, request_rec *r);
|
|||||||
static int proxy_match_hostname(struct dirconn_entry *This, request_rec *r);
|
static int proxy_match_hostname(struct dirconn_entry *This, request_rec *r);
|
||||||
static int proxy_match_word(struct dirconn_entry *This, request_rec *r);
|
static int proxy_match_word(struct dirconn_entry *This, request_rec *r);
|
||||||
static int ap_proxy_retry_worker(const char *proxy_function, proxy_worker *worker, server_rec *s);
|
static int ap_proxy_retry_worker(const char *proxy_function, proxy_worker *worker, server_rec *s);
|
||||||
|
static proxy_worker *proxy_balancer_get_best_worker(proxy_balancer *balancer,
|
||||||
|
request_rec *r,
|
||||||
|
proxy_is_best_callback_fn_t *is_best,
|
||||||
|
void *baton);
|
||||||
|
|
||||||
APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(proxy, PROXY, int, create_req,
|
APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(proxy, PROXY, int, create_req,
|
||||||
(request_rec *r, request_rec *pr), (r, pr),
|
(request_rec *r, request_rec *pr), (r, pr),
|
||||||
@@ -1300,7 +1304,7 @@ PROXY_DECLARE(apr_status_t) ap_proxy_initialize_balancer(proxy_balancer *balance
|
|||||||
return APR_SUCCESS;
|
return APR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
PROXY_DECLARE(proxy_worker *) ap_proxy_balancer_get_best_worker(proxy_balancer *balancer,
|
static proxy_worker *proxy_balancer_get_best_worker(proxy_balancer *balancer,
|
||||||
request_rec *r,
|
request_rec *r,
|
||||||
proxy_is_best_callback_fn_t *is_best,
|
proxy_is_best_callback_fn_t *is_best,
|
||||||
void *baton)
|
void *baton)
|
||||||
@@ -1415,6 +1419,14 @@ PROXY_DECLARE(proxy_worker *) ap_proxy_balancer_get_best_worker(proxy_balancer *
|
|||||||
return best_worker;
|
return best_worker;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PROXY_DECLARE(proxy_worker *) ap_proxy_balancer_get_best_worker(proxy_balancer *balancer,
|
||||||
|
request_rec *r,
|
||||||
|
proxy_is_best_callback_fn_t *is_best,
|
||||||
|
void *baton)
|
||||||
|
{
|
||||||
|
return proxy_balancer_get_best_worker(balancer, r, is_best, baton);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* CONNECTION related...
|
* CONNECTION related...
|
||||||
*/
|
*/
|
||||||
@@ -4079,5 +4091,5 @@ void proxy_util_register_hooks(apr_pool_t *p)
|
|||||||
{
|
{
|
||||||
APR_REGISTER_OPTIONAL_FN(ap_proxy_retry_worker);
|
APR_REGISTER_OPTIONAL_FN(ap_proxy_retry_worker);
|
||||||
APR_REGISTER_OPTIONAL_FN(ap_proxy_clear_connection);
|
APR_REGISTER_OPTIONAL_FN(ap_proxy_clear_connection);
|
||||||
APR_REGISTER_OPTIONAL_FN(ap_proxy_balancer_get_best_worker);
|
APR_REGISTER_OPTIONAL_FN(proxy_balancer_get_best_worker);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user