mirror of
https://github.com/apache/httpd.git
synced 2025-08-08 15:02:10 +03:00
mod_proxy: Follow up to r1912245: ap_proxy_ prefix for extern functions.
Even if they are not part of the API (not in mod_proxy.h) hence requires no MMN bump, {get,set,increment_,decrement_}busy_count() being AP_PROXY_DECLARE()d could name-collide with a third-party module's functions. Rename them using the ap_proxy_ prefix, with an underscore after the verb for for all of them too (for consistency), that is: ap_proxy_{get,set,increment,decrement}_busy_count() git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1913930 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -30,13 +30,13 @@ static APR_OPTIONAL_FN_TYPE(proxy_balancer_get_best_worker)
|
|||||||
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)
|
||||||
{
|
{
|
||||||
int *total_factor = (int *)baton;
|
int *total_factor = (int *)baton;
|
||||||
apr_size_t current_busy = getbusy_count(current);
|
apr_size_t current_busy = ap_proxy_get_busy_count(current);
|
||||||
apr_size_t prev_best_busy = 0;
|
apr_size_t prev_best_busy = 0;
|
||||||
|
|
||||||
current->s->lbstatus += current->s->lbfactor;
|
current->s->lbstatus += current->s->lbfactor;
|
||||||
*total_factor += current->s->lbfactor;
|
*total_factor += current->s->lbfactor;
|
||||||
if (prev_best)
|
if (prev_best)
|
||||||
prev_best_busy = getbusy_count(prev_best);
|
prev_best_busy = ap_proxy_get_busy_count(prev_best);
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -72,7 +72,7 @@ static apr_status_t reset(proxy_balancer *balancer, server_rec *s)
|
|||||||
worker = (proxy_worker **)balancer->workers->elts;
|
worker = (proxy_worker **)balancer->workers->elts;
|
||||||
for (i = 0; i < balancer->workers->nelts; i++, worker++) {
|
for (i = 0; i < balancer->workers->nelts; i++, worker++) {
|
||||||
(*worker)->s->lbstatus = 0;
|
(*worker)->s->lbstatus = 0;
|
||||||
setbusy_count(*worker, 0);
|
ap_proxy_set_busy_count(*worker, 0);
|
||||||
}
|
}
|
||||||
return APR_SUCCESS;
|
return APR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@@ -623,8 +623,8 @@ static int proxy_balancer_pre_request(proxy_worker **worker,
|
|||||||
*worker = runtime;
|
*worker = runtime;
|
||||||
}
|
}
|
||||||
|
|
||||||
increment_busy_count(*worker);
|
ap_proxy_increment_busy_count(*worker);
|
||||||
apr_pool_cleanup_register(r->pool, *worker, decrement_busy_count,
|
apr_pool_cleanup_register(r->pool, *worker, ap_proxy_decrement_busy_count,
|
||||||
apr_pool_cleanup_null);
|
apr_pool_cleanup_null);
|
||||||
|
|
||||||
/* Add balancer/worker info to env. */
|
/* Add balancer/worker info to env. */
|
||||||
@@ -1563,7 +1563,7 @@ static void balancer_display_page(request_rec *r, proxy_server_conf *conf,
|
|||||||
"</httpd:redirect>\n", NULL);
|
"</httpd:redirect>\n", NULL);
|
||||||
ap_rprintf(r,
|
ap_rprintf(r,
|
||||||
" <httpd:busy>%" APR_SIZE_T_FMT "</httpd:busy>\n",
|
" <httpd:busy>%" APR_SIZE_T_FMT "</httpd:busy>\n",
|
||||||
getbusy_count(worker));
|
ap_proxy_get_busy_count(worker));
|
||||||
ap_rprintf(r, " <httpd:lbset>%d</httpd:lbset>\n",
|
ap_rprintf(r, " <httpd:lbset>%d</httpd:lbset>\n",
|
||||||
worker->s->lbset);
|
worker->s->lbset);
|
||||||
/* End proxy_worker_stat */
|
/* End proxy_worker_stat */
|
||||||
@@ -1736,7 +1736,7 @@ static void balancer_display_page(request_rec *r, proxy_server_conf *conf,
|
|||||||
ap_rvputs(r, ap_proxy_parse_wstatus(r->pool, worker), NULL);
|
ap_rvputs(r, ap_proxy_parse_wstatus(r->pool, worker), NULL);
|
||||||
ap_rputs("</td>", r);
|
ap_rputs("</td>", r);
|
||||||
ap_rprintf(r, "<td>%" APR_SIZE_T_FMT "</td>", worker->s->elected);
|
ap_rprintf(r, "<td>%" APR_SIZE_T_FMT "</td>", worker->s->elected);
|
||||||
ap_rprintf(r, "<td>%" APR_SIZE_T_FMT "</td>", getbusy_count(worker));
|
ap_rprintf(r, "<td>%" APR_SIZE_T_FMT "</td>", ap_proxy_get_busy_count(worker));
|
||||||
ap_rprintf(r, "<td>%d</td><td>", worker->s->lbstatus);
|
ap_rprintf(r, "<td>%d</td><td>", worker->s->lbstatus);
|
||||||
ap_rputs(apr_strfsize(worker->s->transferred, fbuf), r);
|
ap_rputs(apr_strfsize(worker->s->transferred, fbuf), r);
|
||||||
ap_rputs("</td><td>", r);
|
ap_rputs("</td><td>", r);
|
||||||
|
@@ -5392,7 +5392,7 @@ PROXY_DECLARE(apr_status_t) ap_proxy_tunnel_create(proxy_tunnel_rec **ptunnel,
|
|||||||
return APR_SUCCESS;
|
return APR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
PROXY_DECLARE(apr_status_t) decrement_busy_count(void *worker_)
|
PROXY_DECLARE(apr_status_t) ap_proxy_decrement_busy_count(void *worker_)
|
||||||
{
|
{
|
||||||
apr_size_t val;
|
apr_size_t val;
|
||||||
proxy_worker *worker = worker_;
|
proxy_worker *worker = worker_;
|
||||||
@@ -5435,7 +5435,7 @@ PROXY_DECLARE(apr_status_t) decrement_busy_count(void *worker_)
|
|||||||
return APR_SUCCESS;
|
return APR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
PROXY_DECLARE(void) increment_busy_count(proxy_worker *worker)
|
PROXY_DECLARE(void) ap_proxy_increment_busy_count(proxy_worker *worker)
|
||||||
{
|
{
|
||||||
apr_size_t val;
|
apr_size_t val;
|
||||||
#if APR_SIZEOF_VOIDP == 4
|
#if APR_SIZEOF_VOIDP == 4
|
||||||
@@ -5475,7 +5475,7 @@ PROXY_DECLARE(void) increment_busy_count(proxy_worker *worker)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
PROXY_DECLARE(apr_size_t) getbusy_count(proxy_worker *worker)
|
PROXY_DECLARE(apr_size_t) ap_proxy_get_busy_count(proxy_worker *worker)
|
||||||
{
|
{
|
||||||
apr_size_t val;
|
apr_size_t val;
|
||||||
#if APR_SIZEOF_VOIDP == 4
|
#if APR_SIZEOF_VOIDP == 4
|
||||||
@@ -5494,7 +5494,7 @@ PROXY_DECLARE(apr_size_t) getbusy_count(proxy_worker *worker)
|
|||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
PROXY_DECLARE(void) setbusy_count(proxy_worker *worker, apr_size_t to)
|
PROXY_DECLARE(void) ap_proxy_set_busy_count(proxy_worker *worker, apr_size_t to)
|
||||||
{
|
{
|
||||||
#if APR_SIZEOF_VOIDP == 4
|
#if APR_SIZEOF_VOIDP == 4
|
||||||
AP_DEBUG_ASSERT(sizeof(apr_size_t) == sizeof(apr_uint32_t));
|
AP_DEBUG_ASSERT(sizeof(apr_size_t) == sizeof(apr_uint32_t));
|
||||||
|
@@ -46,7 +46,7 @@ void proxy_util_register_hooks(apr_pool_t *p);
|
|||||||
* @param worker Pointer to the worker structure.
|
* @param worker Pointer to the worker structure.
|
||||||
* @return apr_size_t value atomically read for the worker.
|
* @return apr_size_t value atomically read for the worker.
|
||||||
*/
|
*/
|
||||||
PROXY_DECLARE(apr_size_t) getbusy_count(proxy_worker *worker);
|
PROXY_DECLARE(apr_size_t) ap_proxy_get_busy_count(proxy_worker *worker);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set the busy counter from the shared worker memory
|
* Set the busy counter from the shared worker memory
|
||||||
@@ -55,7 +55,7 @@ PROXY_DECLARE(apr_size_t) getbusy_count(proxy_worker *worker);
|
|||||||
* @param to value to set the busy counter.
|
* @param to value to set the busy counter.
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
PROXY_DECLARE(void) setbusy_count(proxy_worker *worker, apr_size_t to);
|
PROXY_DECLARE(void) ap_proxy_set_busy_count(proxy_worker *worker, apr_size_t to);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* decrement the busy counter from the shared worker memory
|
* decrement the busy counter from the shared worker memory
|
||||||
@@ -65,7 +65,7 @@ PROXY_DECLARE(void) setbusy_count(proxy_worker *worker, apr_size_t to);
|
|||||||
* @param worker_ Pointer to the worker structure.
|
* @param worker_ Pointer to the worker structure.
|
||||||
* @return apr_status_t returns APR_SUCCESS.
|
* @return apr_status_t returns APR_SUCCESS.
|
||||||
*/
|
*/
|
||||||
PROXY_DECLARE(apr_status_t) decrement_busy_count(void *worker_);
|
PROXY_DECLARE(apr_status_t) ap_proxy_decrement_busy_count(void *worker_);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* increment the busy counter from the shared worker memory
|
* increment the busy counter from the shared worker memory
|
||||||
@@ -73,7 +73,7 @@ PROXY_DECLARE(apr_status_t) decrement_busy_count(void *worker_);
|
|||||||
* @param worker Pointer to the worker structure.
|
* @param worker Pointer to the worker structure.
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
PROXY_DECLARE(void) increment_busy_count(proxy_worker *worker);
|
PROXY_DECLARE(void) ap_proxy_increment_busy_count(proxy_worker *worker);
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user