On Wed, May 12, 2021 at 4:35 PM Ruediger Pluem <[email protected]> wrote:
>
> On 5/12/21 12:10 PM, [email protected] wrote:
> >
> > +static const char * proxyws_fallback_to_proxy_http(cmd_parms *cmd, void 
> > *conf, int arg)
> > +{
> > +    proxyws_dir_conf *dconf = conf;
> > +    dconf->fallback_to_proxy_http = !!arg;
>
> Why !!? Shouldn't just arg be enough?

That's because fallback_to_proxy_http is a bit (i.e. unsigned int :1),
and !!arg is guaranteed to be 0 or 1 (I could have used arg != 0 too).
For instance dconf->fallback_to_proxy_http = 2 wouldn't work as
expected, maybe arg is always 0 or 1 but some compilers warn with
-Woverflow here anyway.

>
> > +    dconf->fallback_to_proxy_http_set = 1;
> > +    return NULL;
> > +}
> > +
> >  static int proxy_wstunnel_post_config(apr_pool_t *pconf, apr_pool_t *plog,
> >                                        apr_pool_t *ptemp, server_rec *s)
> >  {
> > -    fallback_to_mod_proxy_http =
> > +    can_fallback_to_proxy_http =
> >          (ap_find_linked_module("mod_proxy_http.c") != NULL);
> >
> >      return OK;
>
> > @@ -467,6 +507,7 @@ static const command_rec ws_proxy_cmds[]
> >      AP_INIT_TAKE1("ProxyWebsocketAsyncDelay", proxyws_set_asynch_delay, 
> > NULL,
> >                   RSRC_CONF|ACCESS_CONF,
> >                   "amount of time to poll before going asynchronous"),
> > +
>
> Stray empty line?

Well there was one between the existing directives, so I thought I'd
separate the new and {NULL} ones with an empty line too.

>
> >      {NULL}
> >  };


Regards;
Yann.

Reply via email to