crossroads

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

commit 106d478c6f296565889a144abf9a18b724ef77de
parent df260424530daa7c6c6831824834dd869cc7e5ab
Author: finwo <finwo@pm.me>
Date:   Sat,  3 Jan 2026 19:37:02 +0100

2.38

Diffstat:
MChangeLog | 5+++++
MMakefile | 6+++---
Mxrctl/xrctl | 19++++++++++---------
3 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,8 @@ +2.38 [KK 2008-11-19] +- Bugfix in xrctl: Weights and max connections in back ends are now + passed correctly. +- Added version ID to xrctl. + 2.37 [KK 2008-11-17] - Main accept-loop in Balancer::serve() doesn't throw an exception when a network connection can't be accepted. The reason is shown in diff --git a/Makefile b/Makefile @@ -1,7 +1,7 @@ # Top-level Makefile for XR # ------------------------- -VER = 2.37 +VER = 2.38 PREFIX = $(DESTDIR)/usr BINDIR = $(PREFIX)/sbin MANDIR = $(PREFIX)/share/man @@ -48,8 +48,8 @@ install: local $(BINDIR)/xrctl install-manpages @echo ' Have fun with Crossroads $(VER),' @echo ' -- $(MAINTAINER)' @echo -$(BINDIR)/xrctl: xrctl/xrctl - cp xrctl/xrctl $(BINDIR)/xrctl +$(BINDIR)/xrctl: xrctl/xrctl Makefile + sed 's:__VER__:$(VER):' < xrctl/xrctl > $(BINDIR)/xrctl chmod +x $(BINDIR)/xrctl install-manpages: $(MANDIR)/man1/xr.1 $(MANDIR)/man1/xrctl.1 \ $(MANDIR)/man5/xrctl.xml.5 diff --git a/xrctl/xrctl b/xrctl/xrctl @@ -2,6 +2,9 @@ use strict; use Getopt::Std; +# Versioning +my $VER = "__VER__"; + # -------------------------------------------------------------------------- # xrctl: used to start, stop, restart etc. the XR balancer. @@ -259,6 +262,7 @@ sub cmd_generateconfig { sub usage() { die <<"ENDUSAGE"; +This is xrctl V$VER, the control script for XR, the Crossroads Load Balancer. Usage: xrctl [-FLAGS] action [SERVICE ...] Flags are: -v increases verbosity @@ -515,18 +519,15 @@ sub xr_cmdarr { $last_backendcheck = $bc; # Get address, weight and max connections - my $wt = $bp->data('weight') or $default_weight; - my $mx = $bp->data('maxconnections') or $default_maxconnections; my $ad = $bp->data('address') or die ("Backend in service '$service' lacks <address>\n"); + my $mx = $bp->data('maxconnections'); + $mx = $default_maxconnections if (!$mx); + $ad .= ":$mx"; + my $wt = $bp->data('weight'); + $wt = $default_weight if (!$wt); + $ad .= ":$wt"; - if ($mx and - ($wt ne $default_weight or $mx ne $default_maxconnections)) { - $ad .= ":$mx"; - } - if ($wt and ($wt ne $default_weight)) { - $ad .= ":$wt"; - } push (@cmd, '--backend', $ad); }