mod_proxy: follow up to r1822849 and r1822878.
Does r1822878's "static" APR_RETRIEVE_OPTIONAL_FN work if, say, mod_proxy is
builtin but mod_http2 isn't?
Not worth taking the risk here since it's not a fast path...
Note: if this is an issue, I'm afraid it applies elsewhere too.
@@ -1816,17 +1816,10 @@ PROXY_DECLARE(apr_status_t) ap_proxy_share_worker(proxy_worker *worker, proxy_wo
PROXY_DECLARE(apr_status_t) ap_proxy_initialize_worker(proxy_worker *worker, server_rec *s, apr_pool_t *p)
{
- static int have_get_h2_num_workers = 0;
- static APR_OPTIONAL_FN_TYPE(http2_get_num_workers)
- *get_h2_num_workers = NULL;
+ APR_OPTIONAL_FN_TYPE(http2_get_num_workers) *get_h2_num_workers;
apr_status_t rv = APR_SUCCESS;
int max_threads, minw, maxw;
- if (get_h2_num_workers == NULL) {
- get_h2_num_workers = APR_RETRIEVE_OPTIONAL_FN(http2_get_num_workers);
- have_get_h2_num_workers = (get_h2_num_workers != NULL);
- }
-
if (worker->s->status & PROXY_WORKER_INITIALIZED) {
/* The worker is already initialized */
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(00924)
@@ -1854,7 +1847,8 @@ PROXY_DECLARE(apr_status_t) ap_proxy_initialize_worker(proxy_worker *worker, ser
* since it has it's own pool of processing threads.
*/
ap_mpm_query(AP_MPMQ_MAX_THREADS, &max_threads);
- if (have_get_h2_num_workers) {
+ get_h2_num_workers = APR_RETRIEVE_OPTIONAL_FN(http2_get_num_workers);
+ if (get_h2_num_workers) {
get_h2_num_workers(s, &minw, &maxw);
if (max_threads < maxw) {
max_threads = maxw;
