OSDir


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

AW: Current trunk win build error


Looks better than mine, but as we register the function with a different name we need to adjust the parameter to the APR_RETRIEVE_OPTIONAL_FN macro in all mod_lbmethod modules as I did, correct?

 

Regards

 

Rüdiger

 

Von: William A Rowe Jr <wrowe@xxxxxxxxxxxxx>
Gesendet: Montag, 23. Juli 2018 16:54
An: httpd <dev@xxxxxxxxxxxxxxxx>
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.pluem@xxxxxxxxxxxx> 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 <wrowe@xxxxxxxxxxxxx>
Gesendet: Montag, 23. Juli 2018 16:04
An: httpd <dev@xxxxxxxxxxxxxxxx>
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.pluem@xxxxxxxxxxxx> wrote:


> -----Ursprüngliche Nachricht-----
> Von: Apache Lounge <info@xxxxxxxxxxxxxxxx>
> Gesendet: Montag, 23. Juli 2018 13:35
> An: dev@xxxxxxxxxxxxxxxx
> 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