crossroads

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

commit b8775f24d3c75ed5809f26a5d888c10264c931b4
parent 5455d3f7297a563d49cc6e812cab7b9d79a28b81
Author: finwo <finwo@pm.me>
Date:   Sat,  3 Jan 2026 19:33:53 +0100

1.66

Diffstat:
MChangeLog | 6++++++
Mdoc/crossroads.html | 4++--
Mdoc/crossroads.pdf | 0
Metc/Makefile.def | 2+-
Metc/svnrev.txt | 2+-
Msrc/crossroads-daemon/main.c | 2+-
Msrc/crossroads.h | 3+--
Msrc/crossroads/main.c | 2+-
Msrc/lib/allocreporter.c | 2+-
Msrc/lib/ansistamp.c | 2+-
Msrc/lib/backendavailable.c | 2+-
Msrc/lib/backendconnect.c | 2+-
Msrc/lib/backendcount.c | 2+-
Msrc/lib/checkservice.c | 2+-
Msrc/lib/choosebackend.c | 2+-
Msrc/lib/cmdconfigtest.c | 2+-
Msrc/lib/cmdrestart.c | 2+-
Msrc/lib/cmdservices.c | 2+-
Msrc/lib/cmdstart.c | 2+-
Msrc/lib/cmdstatus.c | 2+-
Msrc/lib/cmdstop.c | 2+-
Msrc/lib/cmdtell.c | 2+-
Msrc/lib/configread.c | 2+-
Msrc/lib/configwrite.c | 2+-
Msrc/lib/copysockets.c | 2+-
Msrc/lib/createcommandlinespace.c | 2+-
Msrc/lib/data.c | 2+-
Msrc/lib/deallocreporter.c | 2+-
Msrc/lib/decrclientcount.c | 2+-
Msrc/lib/dns.c | 2+-
Msrc/lib/error.c | 2+-
Dsrc/lib/forktcpservicer.c | 50--------------------------------------------------
Msrc/lib/gmtstamp.c | 2+-
Msrc/lib/hashpjw.c | 2+-
Msrc/lib/httpcopy.c | 2+-
Msrc/lib/httperror.c | 2+-
Msrc/lib/httpheaderaddheader.c | 2+-
Msrc/lib/httpheaderappendheader.c | 2+-
Msrc/lib/httpheaderconnectiontype.c | 2+-
Msrc/lib/httpheaderfree.c | 2+-
Msrc/lib/httpheaderhascookie.c | 2+-
Msrc/lib/httpheaderhttpver.c | 2+-
Msrc/lib/httpheadernew.c | 2+-
Msrc/lib/httpheaderread.c | 2+-
Msrc/lib/httpheaderremoveheader.c | 2+-
Msrc/lib/httpheadersetheader.c | 2+-
Msrc/lib/httpheaderval.c | 2+-
Msrc/lib/httpheaderwrite.c | 2+-
Msrc/lib/httpinsertheader.c | 2+-
Msrc/lib/httpserve.c | 12++++++++----
Msrc/lib/httpserversocket.c | 2+-
Msrc/lib/httpwrite.c | 2+-
Msrc/lib/incrclientcount.c | 2+-
Msrc/lib/initsockaddr.c | 2+-
Msrc/lib/interrupt.c | 2+-
Msrc/lib/ipfaddallow.c | 2+-
Msrc/lib/ipfadddeny.c | 2+-
Msrc/lib/ipfallowed.c | 2+-
Msrc/lib/ipfdenied.c | 2+-
Msrc/lib/ipfloadfile.c | 2+-
Msrc/lib/ipfmatch.c | 2+-
Msrc/lib/ipfparse.c | 2+-
Msrc/lib/ishexdigit.c | 2+-
Msrc/lib/isspace.c | 2+-
Msrc/lib/lexer.c | 2+-
Msrc/lib/lockreporter.c | 2+-
Msrc/lib/logactivityany.c | 2+-
Msrc/lib/logactivitycontinuation.c | 2+-
Msrc/lib/logactivityend.c | 2+-
Msrc/lib/logactivitystart.c | 2+-
Msrc/lib/makesocket.c | 2+-
Msrc/lib/markactivity.c | 2+-
Msrc/lib/msg.c | 2+-
Msrc/lib/msgdumpbuf.c | 2+-
Msrc/lib/netbuffer.c | 2+-
Msrc/lib/netbufread.c | 2+-
Msrc/lib/netcopy.c | 2+-
Msrc/lib/netread.c | 2+-
Msrc/lib/netwrite.c | 2+-
Msrc/lib/parser.c | 2+-
Msrc/lib/parserclose.c | 2+-
Msrc/lib/parserfilename.c | 2+-
Msrc/lib/parserinput.c | 2+-
Msrc/lib/parseropen.c | 2+-
Msrc/lib/parserrun.c | 2+-
Msrc/lib/parserskipchar.c | 2+-
Msrc/lib/parserskipline.c | 2+-
Msrc/lib/runservice.c | 2+-
Msrc/lib/setproctitle.c | 2+-
Msrc/lib/showconfig.c | 2+-
Msrc/lib/stagetostring.c | 2+-
Msrc/lib/statetostring.c | 2+-
Msrc/lib/strcasestr.c | 2+-
Msrc/lib/strexpandformat.c | 2+-
Msrc/lib/stringtostate.c | 2+-
Msrc/lib/strlcat.c | 2+-
Msrc/lib/strprintf.c | 2+-
Msrc/lib/strupr.c | 2+-
Msrc/lib/strvprintf.c | 2+-
Msrc/lib/symtabend.c | 2+-
Msrc/lib/symtablookup.c | 2+-
Msrc/lib/symtabset.c | 2+-
Msrc/lib/symtabstart.c | 2+-
Msrc/lib/sysrun.c | 2+-
Msrc/lib/tcpserve.c | 109+++++++++++++++++++++++++++++++++++++++++++------------------------------------
Msrc/lib/thruputlog.c | 2+-
Msrc/lib/trafficlog.c | 2+-
Msrc/lib/uidassume.c | 2+-
Msrc/lib/uidrestore.c | 2+-
Msrc/lib/unlockreporter.c | 2+-
Msrc/lib/usage.c | 2+-
Msrc/lib/vsyslog.c | 2+-
Msrc/lib/wakeuphandler.c | 2+-
Msrc/lib/warning.c | 2+-
Msrc/lib/writelog.c | 2+-
Msrc/lib/xcalloc.c | 2+-
Msrc/lib/xmalloc.c | 2+-
Msrc/lib/xrealloc.c | 2+-
Msrc/lib/xstrcat.c | 2+-
Msrc/lib/xstrcatch.c | 2+-
Msrc/lib/xstrdup.c | 2+-
121 files changed, 191 insertions(+), 221 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,6 +1,12 @@ ChangeLog for Crossroads ------------------------------------------------------------------------------ +1.66 [KK 2008-01-09] + - Forking of a servicer moved 'forward', before dispatching + phase. That way external dispatchers won't slow down the + listener. This version is EXPERIMENTAL ONLY - use 1.65 until + this code has proven stable. + 1.65 [KK 2008-01-08] - Bugfix in parsing of -B option (TCP buffer size) diff --git a/doc/crossroads.html b/doc/crossroads.html @@ -1,12 +1,12 @@ <a name="../crossroads-defs"></a><a name="defs"></a><html><head> -<title>Crossroads 1.65</title> +<title>Crossroads 1.66</title> <link rel="stylesheet" type="text/css" href="http://www.e-tunity.com/css/yodl.css"> <link rel="stylesheet" type="text/css" href="http://www.e-tunity.com/css/yodl.css"> <link rev="made" href="mailto:info@e-tunity.com"> </head> <body> <hr> -<h1>Crossroads 1.65</h1> +<h1>Crossroads 1.66</h1> <h2>Karel Kubat <br> Maintained by Karel Kubat (karel@kubat.nl)</h2> diff --git a/doc/crossroads.pdf b/doc/crossroads.pdf Binary files differ. diff --git a/etc/Makefile.def b/etc/Makefile.def @@ -6,7 +6,7 @@ # Versioning. This defines the overall version ID and must match the topmost # entry in the ChangeLog. -VER = 1.65 +VER = 1.66 # Years that Crossroads has been 'round. YEARS = 2005-2007 diff --git a/etc/svnrev.txt b/etc/svnrev.txt @@ -1 +1 @@ -207 +208 diff --git a/src/crossroads-daemon/main.c b/src/crossroads-daemon/main.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/crossroads.h b/src/crossroads.h @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ @@ -377,7 +377,6 @@ extern void dealloc_reporter (Service *s); extern struct in_addr *dns (char const *hostname); extern void error (char const *fmt, ...) __attribute__ ((format (printf, 1, 2))); -extern int fork_tcp_servicer (int to_backend); extern char *gmtstamp (int offset); extern unsigned hashpjw (char const *s); extern void http_copy (HttpHeader *h, int src_sock, int dst_sock, diff --git a/src/crossroads/main.c b/src/crossroads/main.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/allocreporter.c b/src/lib/allocreporter.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/ansistamp.c b/src/lib/ansistamp.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/backendavailable.c b/src/lib/backendavailable.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/backendconnect.c b/src/lib/backendconnect.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/backendcount.c b/src/lib/backendcount.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/checkservice.c b/src/lib/checkservice.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/choosebackend.c b/src/lib/choosebackend.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/cmdconfigtest.c b/src/lib/cmdconfigtest.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/cmdrestart.c b/src/lib/cmdrestart.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/cmdservices.c b/src/lib/cmdservices.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/cmdstart.c b/src/lib/cmdstart.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/cmdstatus.c b/src/lib/cmdstatus.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/cmdstop.c b/src/lib/cmdstop.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/cmdtell.c b/src/lib/cmdtell.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/configread.c b/src/lib/configread.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/configwrite.c b/src/lib/configwrite.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/copysockets.c b/src/lib/copysockets.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/createcommandlinespace.c b/src/lib/createcommandlinespace.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/data.c b/src/lib/data.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/deallocreporter.c b/src/lib/deallocreporter.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/decrclientcount.c b/src/lib/decrclientcount.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/dns.c b/src/lib/dns.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/error.c b/src/lib/error.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/forktcpservicer.c b/src/lib/forktcpservicer.c @@ -1,50 +0,0 @@ -/************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over - * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. - * Visit http://crossroads.e-tunity.com for information. - *************************************************************************/ - -#include "../crossroads.h" - -int fork_tcp_servicer (int to_backend) { - int pid, i; - - msg ("Service %s: Forking TCP servicer (to back end: %d)", - activeservice->name, to_backend); - - if ( (pid = fork()) < 0 ) { - /* Fork failure. Return nonzero so that caller thinks they're - * the parent. */ - warning ("Service %s: failed to fork: %s", - activeservice->name, strerror(errno)); - return (-1); - } else if (pid) { - /* Parent branch */ - msg ("Service %s: communications will be handled by pid %d", - activeservice->name, pid); - return (pid); - } else { - /* Child branch: here we will serve the socket pair. - * We want to catch interrupts, but not die. */ - for (i = 0; relevant_sigs[i]; i++) - signal (relevant_sigs[i], interrupt); - - /* Forked for the second time... */ - program_stage = stage_serving; - - if (!leave_proctitle) { - if (to_backend >= 0) - setproctitle ("crossroads - Service %s: serving %s to %s", - client_ip, - activeservice->name, - activeservice->backend [current_backend].name); - else - setproctitle ("crossroads - Service %s: serving %s", - activeservice->name, client_ip); - } - return (0); - } - - /* To satisfy the prototype... */ - return (0); -} diff --git a/src/lib/gmtstamp.c b/src/lib/gmtstamp.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/hashpjw.c b/src/lib/hashpjw.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/httpcopy.c b/src/lib/httpcopy.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/httperror.c b/src/lib/httperror.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/httpheaderaddheader.c b/src/lib/httpheaderaddheader.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/httpheaderappendheader.c b/src/lib/httpheaderappendheader.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/httpheaderconnectiontype.c b/src/lib/httpheaderconnectiontype.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/httpheaderfree.c b/src/lib/httpheaderfree.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/httpheaderhascookie.c b/src/lib/httpheaderhascookie.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/httpheaderhttpver.c b/src/lib/httpheaderhttpver.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/httpheadernew.c b/src/lib/httpheadernew.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/httpheaderread.c b/src/lib/httpheaderread.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/httpheaderremoveheader.c b/src/lib/httpheaderremoveheader.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/httpheadersetheader.c b/src/lib/httpheadersetheader.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/httpheaderval.c b/src/lib/httpheaderval.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/httpheaderwrite.c b/src/lib/httpheaderwrite.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/httpinsertheader.c b/src/lib/httpinsertheader.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/httpserve.c b/src/lib/httpserve.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ @@ -12,9 +12,13 @@ void http_serve (int clientsock) { unsigned char *cp; int size; - /* Fork off a servicer if we're in daemon mode. */ - if (fork_tcp_servicer(-1)) - return; + /* Set relevant sigs etc. */ + program_stage = stage_serving; + for (i = 0; relevant_sigs[i]; i++) + signal (relevant_sigs[i], interrupt); + if (!leave_proctitle) + setproctitle ("crossroads - Service %s: serving %s", + activeservice->name, client_ip); /* We're the child branch now of fork_tcp_servicer(). * Here's the logic of the HTTP services. diff --git a/src/lib/httpserversocket.c b/src/lib/httpserversocket.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/httpwrite.c b/src/lib/httpwrite.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/incrclientcount.c b/src/lib/incrclientcount.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/initsockaddr.c b/src/lib/initsockaddr.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/interrupt.c b/src/lib/interrupt.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/ipfaddallow.c b/src/lib/ipfaddallow.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/ipfadddeny.c b/src/lib/ipfadddeny.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/ipfallowed.c b/src/lib/ipfallowed.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/ipfdenied.c b/src/lib/ipfdenied.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/ipfloadfile.c b/src/lib/ipfloadfile.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/ipfmatch.c b/src/lib/ipfmatch.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/ipfparse.c b/src/lib/ipfparse.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/ishexdigit.c b/src/lib/ishexdigit.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/isspace.c b/src/lib/isspace.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/lexer.c b/src/lib/lexer.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/lockreporter.c b/src/lib/lockreporter.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/logactivityany.c b/src/lib/logactivityany.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/logactivitycontinuation.c b/src/lib/logactivitycontinuation.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/logactivityend.c b/src/lib/logactivityend.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/logactivitystart.c b/src/lib/logactivitystart.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/makesocket.c b/src/lib/makesocket.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/markactivity.c b/src/lib/markactivity.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/msg.c b/src/lib/msg.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/msgdumpbuf.c b/src/lib/msgdumpbuf.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/netbuffer.c b/src/lib/netbuffer.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/netbufread.c b/src/lib/netbufread.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/netcopy.c b/src/lib/netcopy.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/netread.c b/src/lib/netread.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/netwrite.c b/src/lib/netwrite.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/parser.c b/src/lib/parser.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/parserclose.c b/src/lib/parserclose.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/parserfilename.c b/src/lib/parserfilename.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/parserinput.c b/src/lib/parserinput.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/parseropen.c b/src/lib/parseropen.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/parserrun.c b/src/lib/parserrun.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/parserskipchar.c b/src/lib/parserskipchar.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/parserskipline.c b/src/lib/parserskipline.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/runservice.c b/src/lib/runservice.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/setproctitle.c b/src/lib/setproctitle.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/showconfig.c b/src/lib/showconfig.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/stagetostring.c b/src/lib/stagetostring.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/statetostring.c b/src/lib/statetostring.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/strcasestr.c b/src/lib/strcasestr.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/strexpandformat.c b/src/lib/strexpandformat.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/stringtostate.c b/src/lib/stringtostate.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/strlcat.c b/src/lib/strlcat.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/strprintf.c b/src/lib/strprintf.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/strupr.c b/src/lib/strupr.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/strvprintf.c b/src/lib/strvprintf.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/symtabend.c b/src/lib/symtabend.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/symtablookup.c b/src/lib/symtablookup.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/symtabset.c b/src/lib/symtabset.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/symtabstart.c b/src/lib/symtabstart.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/sysrun.c b/src/lib/sysrun.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/tcpserve.c b/src/lib/tcpserve.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ @@ -8,7 +8,7 @@ void tcpserve (int server_sock) { fd_set set; - int backend_sock, new, size, i, pid, backend_selected, counter; + int backend_sock, new, size, i, pid, counter; unsigned octet; char *tmp, *cp, *last = (char *) tcpserve; struct sockaddr_in clientname; @@ -111,6 +111,19 @@ void tcpserve (int server_sock) { client_ip = inet_ntoa (clientname.sin_addr); msg ("Service %s: connection from %s, socket %d", activeservice->name, client_ip, new); + + /* Leave it alone if there are no back ends or if we exceed + * the max allowed clients. IN THAT CASE WE RETURN so that + * runservice() may close the listener socket, sleep, and + * create a new one. + */ + if (! backend_count()) { + warning ("Service %s: no back ends available", + activeservice->name); + close (new); + return; + } + /* Build up the actual client IP as an int. * We need to do this in reverse order; e.g. 1.2.3.4 needs to become * 4<<24 | 3<<16 | 2<<8 | 1. Reason is that when mask /16 applies, @@ -130,7 +143,8 @@ void tcpserve (int server_sock) { } } free (tmp); - + + /* Check allow/deny lists. */ if (ipf_denied ()) { warning ("Service %s: %s matches deny list, " "terminating connection", activeservice->name, client_ip); @@ -144,76 +158,73 @@ void tcpserve (int server_sock) { continue; } - /* Backend yet to be defined. */ + /* All dispatching below is done in a separate fork. + * Dispatching delays (eg. external handlers) won't therefore + * hinder the listener. + */ + if ( (pid = fork()) < 0) + error ("Service %s: Fork failed: %s", + activeservice->name, strerror(errno)); + else if (pid) { + msg ("Service %s: Dispatching phase started as pid %d", + activeservice->name, pid); + close (new); + continue; + } + + /* Here's the child process as dispatcher. The backend has yet + * to be defined. + * NOTE NOTE NOTE No continue's below this point - EXIT! */ current_backend = -1; /* Incase of a http type service: handle separately. */ if (activeservice->type == type_http) { http_serve (new); - close (new); - continue; + exit (0); } - /* This is an 'any' service type. - * Leave it alone if there are no back ends or if we exceed - * the max allowed clients. IN THAT CASE WE RETURN so that - * runservice() may close the listener socket, sleep, and - * create a new one. - */ - if (! backend_count()) { - warning ("Service %s: no back ends available", - activeservice->name); - close (new); - return; - } - /* Retry back ends until we succeed. */ - backend_selected = 0; - while (!backend_selected) { + while (1) { msg ("Service %s: About to choose a back end", activeservice->name); choose_backend(); - if (current_backend < 0) { - /* No back ends available now. NOTE: we return so that - * runservice() will retry in some time. */ - close (new); - return; - } + if (current_backend < 0) + error ("Service %s: Could not select a back end", + activeservice->name); /* Connect to the backend. If this fails then we'll sleep * and re-enter the backend selection loop instead of returning. - * In the loop we may need to decide to return after all. */ + * In the loop we may need to decide to quit after all. */ msg ("Service %s: trying back end %s, port %d", activeservice->name, servicereport->backendstate[current_backend].actual_server, servicereport->backendstate[current_backend].actual_port); if ( (backend_sock = backend_connect()) < 0 ) { - warning ( - "Service %s: failed to connect to server %s:%d " - "(ret %d)", activeservice->name, + warning ("Service %s: failed to connect to server %s:%d " + "(ret %d)", activeservice->name, servicereport->backendstate[current_backend].actual_server, servicereport->backendstate[current_backend].actual_port, backend_sock); continue; } - + /* Got a live one! */ - backend_selected++; - if (fork_tcp_servicer (current_backend)) { - /* We're the parent branch here. Close sockets so that - * we don't run out of file descriptors, and loop into - * the next select/accept run. */ - close (new); - close (backend_sock); - } else { - /* Child branch: piggyback to and fro. - * This one never returns. */ - incr_client_count(); - log_activity_start (); - flag_verbose = - activeservice->backend[current_backend].verbosity; - copysockets (new, backend_sock); - } - } + program_stage = stage_serving; + for (i = 0; relevant_sigs[i]; i++) + signal (relevant_sigs[i], interrupt); + if (!leave_proctitle) + setproctitle ("crossroads - Service %s: serving %s to %s", + activeservice->name, client_ip, + activeservice->backend[current_backend].name); + + /* Child branch: piggyback to and fro. + * This one never returns. */ + incr_client_count(); + log_activity_start (); + flag_verbose = activeservice->backend[current_backend].verbosity; + copysockets (new, backend_sock); + + exit (0); /* superfluous, but what the heck */ + } } } diff --git a/src/lib/thruputlog.c b/src/lib/thruputlog.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/trafficlog.c b/src/lib/trafficlog.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/uidassume.c b/src/lib/uidassume.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/uidrestore.c b/src/lib/uidrestore.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/unlockreporter.c b/src/lib/unlockreporter.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/usage.c b/src/lib/usage.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/vsyslog.c b/src/lib/vsyslog.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/wakeuphandler.c b/src/lib/wakeuphandler.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/warning.c b/src/lib/warning.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/writelog.c b/src/lib/writelog.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/xcalloc.c b/src/lib/xcalloc.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/xmalloc.c b/src/lib/xmalloc.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/xrealloc.c b/src/lib/xrealloc.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/xstrcat.c b/src/lib/xstrcat.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/xstrcatch.c b/src/lib/xstrcatch.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/ diff --git a/src/lib/xstrdup.c b/src/lib/xstrdup.c @@ -1,5 +1,5 @@ /************************************************************************* - * This file is part of Crosroads 1.65, a load balancer and fail over + * This file is part of Crosroads 1.66, a load balancer and fail over * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. * Visit http://crossroads.e-tunity.com for information. *************************************************************************/