On 07/20/2018 02:45 PM, Yann Ylavic wrote:
> On Fri, Jul 20, 2018 at 12:13 PM, Ruediger Pluem <rpl...@apache.org> wrote:
>>
>> Something like the attached? The mod_lbmethod_byrequests.c part needs to be
>> done for lb modules though.
>
> +/* post_config hook: */
> +static int lbmethod_byrequests_post_config(apr_pool_t *pconf, apr_pool_t
> *plog,
> + apr_pool_t *ptemp, server_rec *s)
> +{
> +
> + /* lbmethod_byrequests_post_config() will be called twice during
> startup. So, don't
> + * set up the static data the 1st time through. */
> + if (ap_state_query(AP_SQ_MAIN_STATE) == AP_SQ_MS_CREATE_PRE_CONFIG) {
> + return OK;
> + }
> +
> + if (!ap_proxy_balancer_get_best_worker_fn) {
>
> Shouldn't we remove this check to retrieve the function pointer
> unconditionally?
> With static linking the pointer may not be NULL but still point to
> garbage (mod_lbmethod_byrequests linked statically but mod_proxy
> linked dynamically, if that's ever possible). APR_RETRIEVE_OPTIONAL_FN
> is cheap anyway.
Good point. But I just followed the same pattern as other code in mod_proxy
does :-).
So maybe some checking is due there as well if the conditional fetching should
be removed?
Regards
RĂ¼diger