crossroads

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

commit a4c87a53fff698e749a3f5354277decf9a1e2029
parent f08b10bd9e28e4610f6306569b07b40a5349d629
Author: finwo <finwo@pm.me>
Date:   Sat,  3 Jan 2026 19:38:43 +0100

2.69

Diffstat:
MChangeLog | 10++++++++++
MMakefile | 30++++++++++--------------------
Mdoc/xr.odt | 0
Mdoc/xr.pdf | 0
Mxr/balancer/serve.cc | 5+++++
Axr/etc/make.help | 15+++++++++++++++
Mxr/sys/sys | 6+++++-
7 files changed, 45 insertions(+), 21 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,13 @@ +2.69 [KK 2010-10-08] +- Installation paths in the make install process can be tweaked, + thanks Felix A. W. O. for suggesting this. +- Verbose and debugging output were by mistake both controlled by the + flag --debug (instead of --debug and --verbose). Fixed. +- When the process runs out of open files, XR will sleep for + EMFILE_SEC secs (see the #define in sys/sys). This avoids thrashing + the output log. +- Documentation updated. + 2.68 [KK 2010-09-22] - All sources checked by cppcheck (static code analysis). - License file added. diff --git a/Makefile b/Makefile @@ -1,28 +1,18 @@ # Top-level Makefile for XR # ------------------------- -VER = 2.68 -PREFIX = $(DESTDIR)/usr -BINDIR = $(PREFIX)/sbin -MANDIR = $(PREFIX)/share/man -TAR = /tmp/crossroads-$(VER).tar.gz -AUTHOR = Karel Kubat <karel@kubat.nl> -MAINTAINER = Karel Kubat <karel@kubat.nl> -DISTSITE = http://crossroads.e-tunity.com -BASE = $(shell pwd) +VER ?= 2.69 +PREFIX ?= $(DESTDIR)/usr +BINDIR ?= $(PREFIX)/sbin +MANDIR ?= $(PREFIX)/share/man +TAR ?= /tmp/crossroads-$(VER).tar.gz +AUTHOR ?= Karel Kubat <karel@kubat.nl> +MAINTAINER ?= Karel Kubat <karel@kubat.nl> +DISTSITE ?= http://crossroads.e-tunity.com +BASE ?= $(shell pwd) foo: - @echo - @echo 'Choose:' - @echo ' make local - local program construction' - @echo ' make localprof - local, with profiling info' - @echo ' make localmem - local, with memory debugging' - @echo ' make install - installation to $(BINDIR)' - @echo ' make uninstall - removes installed programs' - @echo ' make clean - removal after local/install' - @echo ' make tar - pack sources in an archive' - @echo ' make commit - commit to repository (maintainer only)' - @echo + @cat xr/etc/make.help local: mkdir -p xr/build diff --git a/doc/xr.odt b/doc/xr.odt Binary files differ. diff --git a/doc/xr.pdf b/doc/xr.pdf Binary files differ. diff --git a/xr/balancer/serve.cc b/xr/balancer/serve.cc @@ -100,6 +100,11 @@ void Balancer::serve() { (socklen_t*) &size)) < 0 ) { warnmsg("Failed to accept network connection: " << strerror(errno) << '\n'); + if (EMFILE_SLEEP && errno == EMFILE) { + warnmsg("Taking a nap for " << EMFILE_SLEEP << + " sec\n"); + sleep(EMFILE_SLEEP); + } continue; } msg ("Accepted connection from " << diff --git a/xr/etc/make.help b/xr/etc/make.help @@ -0,0 +1,15 @@ + +Make what? Choose one of: + make local - local program construction, creates program xr/build/xr + make localprof - with profiling info + make localmem - with memory debugging info + make install - installation to BINDIR (default: /usr/sbin), manpages + under MANDIR (default: /usr/share/man/) + make uninstall - removes installed files + make clean - cleans up build artifacts + make tar - packs sources in an archive under /tmp + make commit - commits to repository, maintainer-only + +You can overrule the install path as follows: +BINDIR=/my/programs/dir MANDIR=/my/manpages/dir make install + diff --git a/xr/sys/sys b/xr/sys/sys @@ -43,6 +43,10 @@ #include <vector> #include <queue> +/* When the system goes out of open files, we take a nap for X secs. Set + * to 0 to suppress this. */ +#define EMFILE_SLEEP 3 + /* Profiling support on/off */ #ifdef PROFILER # define PROFILE(x) Profiler local_prof(x) @@ -102,7 +106,7 @@ char *strnstr (char const *s, char const *find, size_t slen); /* Messaging. Conditionals are defined as a macro to speed things up. */ #define msg(x) \ -if (config.debug() && mutex_lock_cout()) { \ +if (config.verbose() && mutex_lock_cout()) { \ if (config.prefixtimestamp()) { \ Timestamp tm; \ cout << tm.desc() << ' '; \