httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vinicius Petrucci" <vpetru...@ic.uff.br>
Subject changing balancers' elements
Date Tue, 23 Sep 2008 04:35:49 GMT
hi,

i'm writing a module which needs to modifiy the elements (workers) of
load balancers. That is, to move workers between different balancers.

for example, suppose we have two balancers b1 and b2.  also, we have a
worker "w"  to be moved from "b1" to "b2"

Basically, I do a push in b2->workers array:

new_worker = apr_array_push(b2->workers);
memcpy(new_worker, w, sizeof(proxy_worker));

And then I decrement by one the elements from "b1" --- we guarantee
the b1->workers array positions are fixed (shifted):

proxy_worker *tmp_w = w++;
for (j = i; j < b1->workers->nelts-1; j++, tmp_w = w, w++) {
    memcpy(tmp_w, w, sizeof(proxy_worker));
}
b1->workers->nelts--;

the problem is that in my module these changes are made. but when I
use the balancer-manager interface to list the balancer and respective
workers, nothing has changed. This information isn't shared between
the modules?

i'm using the following piece of code to get the configuration so that
I can get balancer and worker data structures references:

conf = (proxy_server_conf *)
ap_get_module_config(frontend_info->s->module_config, &proxy_module);
balancer = (proxy_balancer *) conf->balancers->elts;

thanks,

vinicius

Mime
View raw message