lighttpd forum lighty > mod_proxy + round-robin not working (v1.4.19)

Posted by Ezequiel Guilleron
on 11.07.2008 01:22
Hi,

recently I download the lasted stable version (1.4.19) and found that 
round robin on mod_proxy does not work as expected. After looping the 
first time the back-end selector always return the same back-end:

since the condition to assign a higher back-end is:

    /* get next ndx */ if ((int)k > host->last_used_ndx) {

after the first loop and no reseting the "host->last_used_ndx" on 
back-ends (host) we always get the same back-end over and over again...

the solution is to reset all last_used_ndx on each "host" after a higher 
value of k is reached.

patch is attached. ticket submitted 
(http://trac.lighttpd.net/trac/ticket/1715)

Regards.
Ezequiel,