> -----Original Message----- > From: Jan Kaluža [mailto:jkal...@redhat.com] > Sent: Donnerstag, 11. Dezember 2014 14:40 > To: dev@httpd.apache.org > Subject: Re: [PATCH] Balancers, VirtualHost and ProxyPass > > On 12/11/2014 08:47 AM, Jan Kaluža wrote: > > On 12/10/2014 08:21 PM, Ruediger Pluem wrote: > >> > >> > >> On 12/10/2014 02:21 PM, Jan Kaluža wrote: > >>> On 12/10/2014 01:49 PM, Plüm, Rüdiger, Vodafone Group wrote: > >>>> But this way we lose the base ones that are not touched in the > >>>> virtual host and e.g. are only used by rewriterules. > >>>> So we should transfer the base ones to the merged array in any case > >>>> and update them where needed. > >>> > >>> Hm, you are right. Check the new version attached to this email. > >> > >> But this one changes the parent configuration. So if you have two > >> virtual hosts and in each you change a different > >> parameter of the parent the later one has *both* changes, not only > >> one. So you would need to do a copy of these > >> balancers first and adjust the copy. Then only add the adjusted copy > >> to the result. For the base balancers not matching > >> the override balancers just add them to the result untouched. Same for > >> the override ones, as you already do > > > > That makes sense, thanks. I will work on it and send updated patch. > > I have to admit that this feature is starting to be more time-consuming > than I thought :). The attached patch should address all the issues > pointed by Yann and Rüdiger.
Looks fine in general. Details: + if (!tmp.lbmethod_set && b1->lbmethod_set) { + b2->lbmethod_set = b1->lbmethod_set; + b2->lbmethod = b1->lbmethod; This is already the case because of the + *b2 = *b1; above. So if lbmethod is set differently in overrides you lose it in favour of the base setting. + PROXY_STRNCPY(tmp.s->lbpname, b1->s->lbpname); + } + if (!tmp.growth_set && b1->growth_set) { + b2->growth_set = b1->growth_set; + b2->growth = b1->growth; Same as above + } + if (!tmp.failontimeout_set && b1->failontimeout_set) { + b2->failontimeout_set = b1->failontimeout_set; + b2->failontimeout = b1->failontimeout; + } Same as above. if (apr_is_empty_array(tmp.errstatuses) + && !apr_is_empty_array(b1->errstatuses)) { + apr_array_cat(b2->errstatuses, b1->errstatuses); + } b1 and b2 point to the same array. So the result will be a doubled b1 if apr_array_cat doesn't fail on getting supplied the same pointer twice :-) Regards Rüdiger