git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: svn commit: r1832609 - in /httpd/httpd/branches/2.4.x: ./ docs/manual/howto/ docs/manual/mod/ modules/proxy/ modules/proxy/balancers/



On 07/20/2018 02:45 PM, Yann Ylavic wrote:
> On Fri, Jul 20, 2018 at 12:13 PM, Ruediger Pluem <rpluem@xxxxxxxxxx> 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



( ! ) Warning: include(msgfooter.php): failed to open stream: No such file or directory in /var/www/git/apache2-developers/msg04342.html on line 102
Call Stack
#TimeMemoryFunctionLocation
10.0007364664{main}( ).../msg04342.html:0

( ! ) Warning: include(): Failed opening 'msgfooter.php' for inclusion (include_path='.:/var/www/git') in /var/www/git/apache2-developers/msg04342.html on line 102
Call Stack
#TimeMemoryFunctionLocation
10.0007364664{main}( ).../msg04342.html:0