From 0990c81134a11dbb1b4fe9f77a9842ac8abdb467 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BChler?= Date: Thu, 9 Apr 2009 16:51:46 +0000 Subject: [PATCH] Fix mod_proxy RoundRobin (off by one problem if only one backend is up) git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2432 152afb58-edef-0310-8abb-c4023f1b3aa9 --- NEWS | 1 + src/mod_proxy.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index a57e71d2..c63adf69 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,7 @@ NEWS * Remove link from errormsg about fastcgi apps (fixes #1942) * Strip trailing dot from "Host:" header * Remove the optional port info from SERVER_NAME (thx Mr_Bond) + * Fix mod_proxy RoundRobin (off by one problem if only one backend is up) - 1.4.22 - 2009-03-07 * Fix wrong lua type for CACHE_MISS/CACHE_HIT in mod_cml (fixes #533) diff --git a/src/mod_proxy.c b/src/mod_proxy.c index 74a0bdb7..ba20ebab 100644 --- a/src/mod_proxy.c +++ b/src/mod_proxy.c @@ -1209,7 +1209,7 @@ static handler_t mod_proxy_check_extension(server *srv, connection *con, void *p if (ndx >= (int) extension->value->used) { /* didn't found a higher id, wrap to the start */ - for (ndx = 0; ndx < (int) k; ndx++) { + for (ndx = 0; ndx <= (int) k; ndx++) { host = (data_proxy *)extension->value->data[ndx]; if (!host->is_disabled) break; }