crossroads

Git mirror of https://crossroads.e-tunity.com/
git clone git://git.finwo.net/app/crossroads
Log | Files | Refs | LICENSE

commit 8919cc1eda7a76e1deec7547d7988d465b093b74
parent 08e0eaba939f8e4c87f90f58506492bb0a5ad916
Author: finwo <finwo@pm.me>
Date:   Sat,  3 Jan 2026 19:37:39 +0100

2.52

Diffstat:
MChangeLog | 6++++++
MMakefile | 2+-
Mxr/DispatchAlgorithms/roundrobin/target.cc | 12++++++++++--
Mxr/Dispatchers/tcpdispatcher/dispatch.cc | 1-
4 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,9 @@ +2.52 [KK 2009-04-21] +- Bugfix in the roundrobin dispatcher. When only one back end would be + up, then the roundrobin dispatcher would incorrectly compute the + right back end. This bug only became visible with host-matching in + HTTP mode. + 2.51 [KK 2009-04-15] - Separate "write" timeouts introduced in flags -t and -T - Web interface activity overview includes client ip addresses diff --git a/Makefile b/Makefile @@ -1,7 +1,7 @@ # Top-level Makefile for XR # ------------------------- -VER = 2.51 +VER = 2.52 PREFIX = $(DESTDIR)/usr BINDIR = $(PREFIX)/sbin MANDIR = $(PREFIX)/share/man diff --git a/xr/DispatchAlgorithms/roundrobin/target.cc b/xr/DispatchAlgorithms/roundrobin/target.cc @@ -5,8 +5,17 @@ unsigned Roundrobin::target(struct in_addr clientip, // No back ends? Don't even try. One back end? Always that one. if (targetlist.size() == 0) throw Error("Round robin dispatcher: no backends\n"); + + if (config.debug()) + for (unsigned i = 0; i < targetlist.size(); i++) { + unsigned backend_index = targetlist[i]; + _debugmsg(Mstr("Round robin dispatcher: target ") + + Mstr(i) + Mstr(" is ") + + balancer.backend(backend_index).description() + "\n"); + } + if (targetlist.size() == 1) - return (0); + return (targetlist[0]); static int prev_run_index = -1; @@ -41,4 +50,3 @@ unsigned Roundrobin::target(struct in_addr clientip, return (targetlist[cur_val]); } } - diff --git a/xr/Dispatchers/tcpdispatcher/dispatch.cc b/xr/Dispatchers/tcpdispatcher/dispatch.cc @@ -15,7 +15,6 @@ void TcpDispatcher::dispatch() { Mstr(i) + "\n"); balancer.backend(i).anticipated(0); } - msg (Mstr("Anticipation forwarding reset.\n")); // Build up the target list, if not yet done so. The HTTP dispatcher // might've created it already for host-based matching (in which case