crossroads

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

commit 53ad389dd9d0f5689cd8a2f3b5155eae6515905c
parent 780d4f60c8cc41e012992b78e7e7349653b7077c
Author: finwo <finwo@pm.me>
Date:   Sat,  3 Jan 2026 19:35:10 +0100

2.07

Diffstat:
MChangeLog | 3+++
MMakefile | 2+-
Mxr/backend/available.cc | 7+++++++
Mxr/backend/backend | 12++++++------
Mxr/backend/backend1.cc | 6+-----
Mxr/backend/backend2.cc | 3++-
Mxr/sys/main.cc | 5+----
7 files changed, 21 insertions(+), 17 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,6 @@ +2.07 [KK 2008-08-28] +Stupid bug in 2.06, sorry that 2.06 got out.. Fixed. + 2.06 [KK 2008-08-27] Upped c-conf to 1.14. xrctl updated: 'ps' command format also suitable for SunOS. diff --git a/Makefile b/Makefile @@ -1,7 +1,7 @@ # Top-level Makefile for XR # ------------------------- -VER = 2.06 +VER = 2.07 BINDIR = /usr/sbin TAR = /tmp/crossroads-$(VER).tar.gz AUTHOR = Karel Kubat <karel@kubat.nl> diff --git a/xr/backend/available.cc b/xr/backend/available.cc @@ -1,6 +1,13 @@ #include "backend" bool Backend::available() const { + if (config.debug()) { + ostringstream o; + o << (islive ? "alive" : "dead") << ", " + << connections() << " connections, " << ", of " + << maxconn() << " max"; + debugmsg ("Backend " + description() + ": " + o.str() + "\n"); + } if (!maxconn()) return (islive); return (islive && connections() < maxconn()); diff --git a/xr/backend/backend b/xr/backend/backend @@ -31,9 +31,9 @@ public: double bytesserved() const { return (bytes_served); } unsigned clientsserved() const { return (totconn); } - static void addbytes (unsigned n); - static void startconnection(); - static void endconnection(); + void addbytes (unsigned n); + void startconnection(); + void endconnection(); BackendDef const &backenddef() const { return (bdef); @@ -41,10 +41,10 @@ public: private: BackendDef bdef; - static bool islive; + bool islive; int clsocket; - static unsigned nconn, totconn; - static double bytes_served; + unsigned nconn, totconn; + double bytes_served; }; #endif diff --git a/xr/backend/backend1.cc b/xr/backend/backend1.cc @@ -1,9 +1,5 @@ #include "backend" -bool Backend::islive = true; -unsigned Backend::nconn = 0, Backend::totconn = 0; -double Backend::bytes_served = 0; - Backend::Backend () : - clsocket(-1) { + islive(true), clsocket(-1), nconn(0), totconn(0), bytes_served(0) { } diff --git a/xr/backend/backend2.cc b/xr/backend/backend2.cc @@ -1,5 +1,6 @@ #include "backend" Backend::Backend (BackendDef const &b) : - bdef(b), clsocket(-1) { + bdef(b), islive(true), clsocket(-1), nconn(0), totconn(0), + bytes_served(0) { } diff --git a/xr/sys/main.cc b/xr/sys/main.cc @@ -30,11 +30,8 @@ int main (int argc, char **argv) { msg ("XR running as PID " + o.str() + "\n"); // Load the signal handler. - for (unsigned i = 0; i < sizeof(relevant_sig) / sizeof(int); i++) { - cout << relevant_sig[i] << "\n"; + for (unsigned i = 0; i < sizeof(relevant_sig) / sizeof(int); i++) signal (relevant_sig[i], sigcatcher); - } - cout << "ok\n"; // Configure the balancer and start serving. balancer.init();