+1, looks great.

On Tue, Jul 24, 2018 at 1:34 AM, Plüm, Rüdiger, Vodafone Group <
ruediger.pl...@vodafone.com> wrote:

> Unfortunately this did not work and caused.
>
>
>
> In file included from mod_proxy.h:30:0,
>
>                  from proxy_util.c:18:
>
> proxy_util.c: In function 'proxy_util_register_hooks':
>
> /home/pluem/apache/httpd-trunk/srclib/apr/include/apr_optional.h:42:36:
> error: unknown type name 'apr_OFN_proxy_balancer_get_best_worker_t'
>
> #define APR_OPTIONAL_FN_TYPE(name) apr_OFN_##name##_t
>
>                                     ^
>
> /home/pluem/apache/httpd-trunk/srclib/apr/include/apr_optional.h:71:3:
> note: in expansion of macro 'APR_OPTIONAL_FN_TYPE'
>
>    APR_OPTIONAL_FN_TYPE(name) *apu__opt = name; \
>
>    ^
>
> proxy_util.c:4094:5: note: in expansion of macro 'APR_REGISTER_OPTIONAL_FN'
>
>      APR_REGISTER_OPTIONAL_FN(proxy_balancer_get_best_worker);
>
>      ^
>
> proxy_util.c:4094:30: warning: initialization from incompatible pointer
> type [enabled by default]
>
>      APR_REGISTER_OPTIONAL_FN(proxy_balancer_get_best_worker);
>
>                               ^
>
> /home/pluem/apache/httpd-trunk/srclib/apr/include/apr_optional.h:71:42:
> note: in definition of macro 'APR_REGISTER_OPTIONAL_FN'
>
>    APR_OPTIONAL_FN_TYPE(name) *apu__opt = name; \
>
>                                           ^
>
> make[4]: *** [proxy_util.slo] Error 1
>
> make[3]: *** [shared-build-recursive] Error 1
>
> make[2]: *** [shared-build-recursive] Error 1
>
> make[1]: *** [shared-build-recursive] Error 1
>
> make: *** [all-recursive] Error 1
>
>
>
> The attached one which is shorter then my original one, but longer than
> yours and does work.
>
>
>
>
>
>
>
> Regards
>
>
>
> Rüdiger
>
>
>
> *Von:* William A Rowe Jr <wr...@rowe-clan.net>
> *Gesendet:* Montag, 23. Juli 2018 16:54
>
> *An:* httpd <dev@httpd.apache.org>
> *Betreff:* Re: Current trunk win build error
>
>
>
> I think it's simply the attached (couldn't apply the inline text patch).
>
>
>
> No need to change the hook name.
>
>
>
> On Mon, Jul 23, 2018 at 9:16 AM, Plüm, Rüdiger, Vodafone Group <
> ruediger.pl...@vodafone.com> wrote:
>
> So something like the below?
>
>
>
> Regards
>
>
>
> Rüdiger
>
>
>
> Index: modules/proxy/balancers/mod_lbmethod_bybusyness.c
>
> ===================================================================
>
> --- modules/proxy/balancers/mod_lbmethod_bybusyness.c       (revision
> 1836460)
>
> +++ modules/proxy/balancers/mod_lbmethod_bybusyness.c    (working copy)
>
> @@ -22,8 +22,8 @@
>
>  module AP_MODULE_DECLARE_DATA lbmethod_bybusyness_module;
>
> -static APR_OPTIONAL_FN_TYPE(ap_proxy_balancer_get_best_worker)
>
> -                            *ap_proxy_balancer_get_best_worker_fn = NULL;
>
> +static APR_OPTIONAL_FN_TYPE(proxy_balancer_get_best_worker)
>
> +                            *proxy_balancer_get_best_worker_fn = NULL;
>
>  static int is_best_bybusyness(proxy_worker *current, proxy_worker
> *prev_best, void *baton)
>
> {
>
> @@ -47,7 +47,7 @@
>
> {
>
>      int total_factor = 0;
>
>      proxy_worker *worker =
>
> -        ap_proxy_balancer_get_best_worker_fn(balancer, r,
> is_best_bybusyness,
>
> +        proxy_balancer_get_best_worker_fn(balancer, r,
> is_best_bybusyness,
>
>                                            &total_factor);
>
>      if (worker) {
>
> @@ -96,9 +96,9 @@
>
>          return OK;
>
>      }
>
> -    ap_proxy_balancer_get_best_worker_fn =
>
> -                 APR_RETRIEVE_OPTIONAL_FN(ap_proxy_balancer_get_best_
> worker);
>
> -    if (!ap_proxy_balancer_get_best_worker_fn) {
>
> +    proxy_balancer_get_best_worker_fn =
>
> +                 APR_RETRIEVE_OPTIONAL_FN(proxy_balancer_get_best_
> worker);
>
> +    if (!proxy_balancer_get_best_worker_fn) {
>
>          ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(10151)
>
>                       "mod_proxy must be loaded for
> mod_lbmethod_bybusyness");
>
>          return !OK;
>
> Index: modules/proxy/balancers/mod_lbmethod_byrequests.c
>
> ===================================================================
>
> --- modules/proxy/balancers/mod_lbmethod_byrequests.c        (revision
> 1836460)
>
> +++ modules/proxy/balancers/mod_lbmethod_byrequests.c     (working copy)
>
> @@ -22,8 +22,8 @@
>
>  module AP_MODULE_DECLARE_DATA lbmethod_byrequests_module;
>
> -static APR_OPTIONAL_FN_TYPE(ap_proxy_balancer_get_best_worker)
>
> -                            *ap_proxy_balancer_get_best_worker_fn = NULL;
>
> +static APR_OPTIONAL_FN_TYPE(proxy_balancer_get_best_worker)
>
> +                            *proxy_balancer_get_best_worker_fn = NULL;
>
>  static int is_best_byrequests(proxy_worker *current, proxy_worker
> *prev_best, void *baton)
>
> {
>
> @@ -84,7 +84,7 @@
>
>                                  request_rec *r)
>
> {
>
>      int total_factor = 0;
>
> -    proxy_worker *worker = ap_proxy_balancer_get_best_worker_fn(balancer,
> r, is_best_byrequests, &total_factor);
>
> +    proxy_worker *worker = proxy_balancer_get_best_worker_fn(balancer,
> r, is_best_byrequests, &total_factor);
>
>      if (worker) {
>
>          worker->s->lbstatus -= total_factor;
>
> @@ -137,9 +137,9 @@
>
>          return OK;
>
>      }
>
> -    ap_proxy_balancer_get_best_worker_fn =
>
> -                 APR_RETRIEVE_OPTIONAL_FN(ap_proxy_balancer_get_best_
> worker);
>
> -    if (!ap_proxy_balancer_get_best_worker_fn) {
>
> +    proxy_balancer_get_best_worker_fn =
>
> +                 APR_RETRIEVE_OPTIONAL_FN(proxy_balancer_get_best_
> worker);
>
> +    if (!proxy_balancer_get_best_worker_fn) {
>
>          ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(10152)
>
>                       "mod_proxy must be loaded for
> mod_lbmethod_byrequests");
>
>          return !OK;
>
> Index: modules/proxy/balancers/mod_lbmethod_bytraffic.c
>
> ===================================================================
>
> --- modules/proxy/balancers/mod_lbmethod_bytraffic.c
> (revision 1836460)
>
> +++ modules/proxy/balancers/mod_lbmethod_bytraffic.c          (working
> copy)
>
> @@ -22,8 +22,8 @@
>
>  module AP_MODULE_DECLARE_DATA lbmethod_bytraffic_module;
>
> -static APR_OPTIONAL_FN_TYPE(ap_proxy_balancer_get_best_worker)
>
> -                            *ap_proxy_balancer_get_best_worker_fn = NULL;
>
> +static APR_OPTIONAL_FN_TYPE(proxy_balancer_get_best_worker)
>
> +                            *proxy_balancer_get_best_worker_fn = NULL;
>
>  static int is_best_bytraffic(proxy_worker *current, proxy_worker
> *prev_best, void *baton)
>
> {
>
> @@ -62,7 +62,7 @@
>
> {
>
>      apr_off_t min_traffic = 0;
>
> -    return ap_proxy_balancer_get_best_worker_fn(balancer, r,
> is_best_bytraffic,
>
> +    return proxy_balancer_get_best_worker_fn(balancer, r,
> is_best_bytraffic,
>
>                                               &min_traffic);
>
> }
>
> @@ -107,9 +107,9 @@
>
>          return OK;
>
>      }
>
> -    ap_proxy_balancer_get_best_worker_fn =
>
> -                 APR_RETRIEVE_OPTIONAL_FN(ap_proxy_balancer_get_best_
> worker);
>
> -    if (!ap_proxy_balancer_get_best_worker_fn) {
>
> +    proxy_balancer_get_best_worker_fn =
>
> +                 APR_RETRIEVE_OPTIONAL_FN(proxy_balancer_get_best_
> worker);
>
> +    if (!proxy_balancer_get_best_worker_fn) {
>
>          ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(10150)
>
>                       "mod_proxy must be loaded for
> mod_lbmethod_bytraffic");
>
>          return !OK;
>
> Index: modules/proxy/mod_proxy.h
>
> ===================================================================
>
> --- modules/proxy/mod_proxy.h             (revision 1836460)
>
> +++ modules/proxy/mod_proxy.h           (working copy)
>
> @@ -883,7 +883,7 @@
>
> /*
>
>   * Needed by the lb modules.
>
>   */
>
> -APR_DECLARE_OPTIONAL_FN(proxy_worker *, ap_proxy_balancer_get_best_
> worker,
>
> +APR_DECLARE_OPTIONAL_FN(proxy_worker *, proxy_balancer_get_best_worker,
>
>                                          (proxy_balancer *balancer,
>
>                                           request_rec *r,
>
>                                           proxy_is_best_callback_fn_t
> *is_best,
>
> Index: modules/proxy/proxy_util.c
>
> ===================================================================
>
> --- modules/proxy/proxy_util.c (revision 1836460)
>
> +++ modules/proxy/proxy_util.c              (working copy)
>
> @@ -1415,6 +1415,13 @@
>
>      return best_worker;
>
> }
>
> +static proxy_worker* proxy_balancer_get_best_worker(proxy_balancer
> *balancer,
>
> +
>                  request_rec *r,
>
> +
> proxy_is_best_callback_fn_t *is_best,
>
> +                                                                void
> *baton)
>
> +{
>
> +    return ap_proxy_balancer_get_best_worker(balancer, r, is_best,
> baton);
>
> +}
>
> /*
>
>   * CONNECTION related...
>
>   */
>
> @@ -4079,5 +4086,5 @@
>
> {
>
>      APR_REGISTER_OPTIONAL_FN(ap_proxy_retry_worker);
>
>      APR_REGISTER_OPTIONAL_FN(ap_proxy_clear_connection);
>
> -    APR_REGISTER_OPTIONAL_FN(ap_proxy_balancer_get_best_worker);
>
> +    APR_REGISTER_OPTIONAL_FN(proxy_balancer_get_best_worker);
>
> }
>
>
>
> *Von:* William A Rowe Jr <wr...@rowe-clan.net>
> *Gesendet:* Montag, 23. Juli 2018 16:04
> *An:* httpd <dev@httpd.apache.org>
> *Betreff:* Re: Current trunk win build error
>
>
>
> Perhaps use proxy_balancer_get_best_worker, and don't export
>
> that? That can be the delegate for ap_proxy_balancer_get_best_worker.
>
>
>
> We either keep callbacks local, or export them _NONSTD. All the
>
> *_DECLARE (without _NONSTD) are not usable as apr/httpd
>
> callbacks.
>
>
>
>
>
> On Mon, Jul 23, 2018 at 7:22 AM, Plüm, Rüdiger, Vodafone Group <
> ruediger.pl...@vodafone.com> wrote:
>
>
> > -----Ursprüngliche Nachricht-----
> > Von: Apache Lounge <i...@apachelounge.com>
> > Gesendet: Montag, 23. Juli 2018 13:35
> > An: dev@httpd.apache.org
> > Betreff: Current trunk win build error
>
> >
> >
> >
> >
> >
> > Error C2440 'initializing': cannot convert from 'proxy_worker
> > *(__stdcall *)(proxy_balancer *,request_rec
> > *,proxy_is_best_callback_fn_t (__cdecl *),void *)' to
> > 'apr_OFN_ap_proxy_balancer_get_best_worker_t (__cdecl *)'
> >
> > mod_proxy c:\vc15\win32\httpd-trunk\modules\proxy\proxy_util.c 4082
> >
>
> Windows experts to the rescue please :-)
> Seems to be an issue between PROXY_DECLARE and the optional function stuff.
> Does the following patch fix it (just guessing)?
>
> Index: mod_proxy.h
> ===================================================================
> --- mod_proxy.h (revision 1836460)
> +++ mod_proxy.h (working copy)
> @@ -883,7 +883,7 @@
>  /*
>   * Needed by the lb modules.
>   */
> -APR_DECLARE_OPTIONAL_FN(proxy_worker *, ap_proxy_balancer_get_best_
> worker,
> +APR_DECLARE_OPTIONAL_FN(PROXY_DECLARE(proxy_worker *),
> ap_proxy_balancer_get_best_worker,
>                                          (proxy_balancer *balancer,
>                                           request_rec *r,
>                                           proxy_is_best_callback_fn_t
> *is_best,
>
>
>
> Regards
>
> Rüdiger
>
>
>
>
>

Reply via email to