[-]
[+]
|
Changed |
crossroads.spec
|
|
[-]
[+]
|
Changed |
crossroads-devel.ChangeLog
^
|
@@ -1,3 +1,160 @@
+2.67 [KK 2010-06-11]
+- Further bugfix in xrctl to shell-escape all XR parameters where
+ necessary (including e.g. url matching regexps etc.).
+
+2.66 [KK 2010-06-09]
+- Bugfix in xrctl, --host-match arguments are now shell-quoted (they
+ are regular expressions and can contain pipe characters etc). Thanks
+ Chewped for reporting.
+
+2.65 [KK 2010-04-26]
+- Bugfix in backend/connect.cc - if the determination whether a back
+ end is available goes haywire, the client socket may stay open and
+ not be consumed. Thanks Franz J. for reporting!
+- Version stamped as STABLE.
+
+2.64 [KK 2010-01-29]
+- Fixed signal handling for start/stop/restart.
+- Web interface now immediately shuts down at a stop request, so that
+ next xr instances can grab the web interface port immediately.
+
+2.63 [KK 2010-01-11]
+- Previous 2.62 stamped as stable, 2.63 will be the new development
+ trunk.
+
+2.62 [KK 2010-01-08]
+- Fixed possible coredump cause in Balancer::serve(), which might
+ explain some troubles during high load (many really concurrent requests).
+
+2.61 [KK 2009-11-17]
+- Netbuffer::netwrite() will abort after 5 attempts that yield 0
+ written bytes. Probable cause of CPU hogging - thx Franz J. for
+ reporting.
+- Fixed potential cause of crashes in base class for Dispatcher
+ (algorithm handler would not get initialized in the constructors).
+
+2.60 [KK 2009-11-02]
+- Some errors demoted to informational messages to choke the amount of
+ log information that's generated.
+
+2.59 [KK 2009-10-14]
+- Bugfix in logger handling of xrctl, read
+ http://xrforum.org/viewtopic.php?t=495 if you fancy. Thanks Hobbit
+ for reporting this!
+
+2.58 [KK 2009-10-14]
+- Added test/ftp.xml as a sample ftp service configuration.
+- Implemented URL-based dispatching: flag --url-match/-j, present in
+ xrctl, tested in test/urlmatch.xml, added to web interface
+- Usage information now shows long versions of flags first.
+
+2.57 [KK 2009-09-14]
+- Output of "xrctl status" colorized when a service is not running,
+ thanks Frederik D. for the suggestion and the code!
+- Small cleanup of xrctl's usage information.
+
+2.56 [KK 2009-05-26]
+- Bugfix in cleaning of IPStore map
+- Implemented flag --remove-reservations (xrctl: tag: removereservations)
+- Timeouts adjusted: all read time outs set to 30, client-write set to
+ 5, backend-write set to 3
+- Implemented tag prefixtimestamp in system block to force timestamping.
+
+2.55 [KK 2009-05-13]
+- Implemented connection error counting of back ends.
+- Select-handling revised: atomic readability and writeability checks,
+ see xr/fdset/wait.cc and wait_r(), wait_w(), wait_rw().
+- Checks for connect() success can be configured to verify only
+ writeable status of a socket (see xr/backend/connect.cc, macro
+ CONNECTCHECK_ONLY_WRITABLE in xr/etc/Makefile.class).
+- Added test/xr-mysql-connect.
+- Added commands kill and killstart to xrctl. Action restart renamed
+ to stopstart.
+- Added simple benchmarking under test/: xr-http-test (based on an
+ older script) and xr-smtp-test. Plus a simple analyzer of the
+ reported timings, xr-analyze-test.
+- Revamped stored-ip dispatcher, added IPStore class to keep track of clients.
+
+2.54 [KK 2009-04-29]
+- Stamped new STABLE version.
+
+2.53 [KK 2009-04-24]
+- test/xr-client-ping now can live without LWP::UserAgent. When this
+ Perl module is not present, the script will fall back to wget/curl.
+- Upon thread kill, sockets are closed using socketclose()
+ (sys/socketclose.cc), which also shutdown()s the socket.
+- Bugfix in xrctl regarding new format of client/backend timeout.
+
+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
+- Added test/xr-client-ping (see docs)
+
+2.50 [KK 2009-03-30]
+- Bugfix in activation of the onfail script in the checkup thread.
+- Compilation flag -Werror only passed to the compiler when on the
+ development system Thera.local (see xr/etc/Makefile.class).
+- Onstart, onend and onfail scripts (when present) are invoked with a
+ third argument, the number of connections at the time
+- Set-Cookie header directive (see the HTTP dispatcher) attaches an
+ explicit path "/".
+- Rewired the tcp dispatcher and http dispatcher to use a common
+ buffer inside the tcp dispatcher (instead of 2 separate ones).
+
+2.49 [KK 2009-03-27]
+- Implemented onfail hook (to complement onstart/onend, flag -y).
+
+2.48 [KK 2009-03-26]
+- Implemented onstart/onend hooks (flags -z, -Z).
+- Sticky HTTP mode inspects the URI (parameter XRTarget) when no
+ sticky cookie is present.
+
+2.47 [KK 2009-03-04]
+- Stored-ip dispatching was enhanced to "anticipate" reconnects from
+ previously seen clients. The number of anticipated connections is taken
+ into account when dispatching a new client.
+- Bugfix in command line parsing of dispatch mode lax-stored-ip (would
+ be recognized as strict).
+
+2.46 [KK 2009-02-18]
+- Dispatcher-related classes moved under directory xr/Dispatchers/.
+- UDP balancer implementation started (code stubs in place).
+- xrctl bugfixed: a backend-scope maxconnections statement would
+ confuse the global server block. Thanks Rajeev for reporting.
+
+2.45 [KK 2009-02-18]
+- Usage information formatted.
+- Rubberstamped "stable"!
+
+2.44 [KK 2009-02-11]
+- Reviewed code for "throw"s (edited for consistency).
+- Bug in Webinterface::execute() (during accept()). Thanks Vladimir T.
+ for reporting and testing.
+
+2.43 [KK 2009-02-09]
+- Added Httpbuffer::replaceheader() methods
+- Added flag -I (to replace Host: headers), integrated in xrctl /
+ webinterface
+- Webinterface reports approx. # of open fd's and the limit (in activity)
+
+2.42 [KK 2009-01-28]
+- Bugfix in "xrctl generateconfig". The activity info introduced
+ before (which the web interface now emites), confused xrctl.
+- Bugfix in sys/ipmatch.cc: mask matching corrected for systems where
+ longs are not 4 bytes (64bit systems).
+- Bugfix in hashed-ip dispatch mode: When no back ends were available,
+ the dispatcher would crash (fixed).
+- XSLT stylesheet that transforms web interface slightly changed to
+ improve the looks.
+- Bugfix in xrctl's "rotate" action. Thanks "ncisrael" for reporting
+ it in the forum.
+
2.41 [KK 2009-01-05]
- Bugfix in xrctl, thanks Eddie for reporting it.
|
[-]
[+]
|
Changed |
crossroads-devel.tar.gz/ChangeLog
^
|
@@ -1,3 +1,23 @@
+2.67 [KK 2010-06-11]
+- Further bugfix in xrctl to shell-escape all XR parameters where
+ necessary (including e.g. url matching regexps etc.).
+
+2.66 [KK 2010-06-09]
+- Bugfix in xrctl, --host-match arguments are now shell-quoted (they
+ are regular expressions and can contain pipe characters etc). Thanks
+ Chewped for reporting.
+
+2.65 [KK 2010-04-26]
+- Bugfix in backend/connect.cc - if the determination whether a back
+ end is available goes haywire, the client socket may stay open and
+ not be consumed. Thanks Franz J. for reporting!
+- Version stamped as STABLE.
+
+2.64 [KK 2010-01-29]
+- Fixed signal handling for start/stop/restart.
+- Web interface now immediately shuts down at a stop request, so that
+ next xr instances can grab the web interface port immediately.
+
2.63 [KK 2010-01-11]
- Previous 2.62 stamped as stable, 2.63 will be the new development
trunk.
|
[-]
[+]
|
Changed |
crossroads-devel.tar.gz/Makefile
^
|
@@ -1,7 +1,7 @@
# Top-level Makefile for XR
# -------------------------
-VER = 2.63
+VER = 2.67
PREFIX = $(DESTDIR)/usr
BINDIR = $(PREFIX)/sbin
MANDIR = $(PREFIX)/share/man
|
|
Changed |
crossroads-devel.tar.gz/doc/xr.odt
^
|
|
Changed |
crossroads-devel.tar.gz/doc/xr.pdf
^
|
[-]
[+]
|
Changed |
crossroads-devel.tar.gz/test/sampleconf.xml
^
|
@@ -186,7 +186,7 @@
server. The back end is eligible for www.myothersite.org. -->
<address>server3:80</address>
<backendcheck>get:server3:80/healthcheck.cgi</backendcheck>
- <hostmatch>www.myothersite.org</hostmatch>
+ <hostmatch>(www.myothersite.org)|(www.yetanothersite.org)</hostmatch>
</backend>
</service>
|
[-]
[+]
|
Changed |
crossroads-devel.tar.gz/xr/Dispatchers/httpdispatcher/dispatch.cc
^
|
@@ -50,14 +50,16 @@
if (hostmatchused &&
regexec(&(balancer.backend(i).hostregex()),
host_header.c_str(), 0, 0, 0)) {
- debugmsg("Back end " + balancer.backend(i).description() +
+ debugmsg("Back end " +
+ balancer.backend(i).description() +
" forbidden due to hostmatch\n");
host_allowed = false;
}
if (urlmatchused &&
regexec(&(balancer.backend(i).urlregex()),
url.c_str(), 0, 0, 0)) {
- debugmsg("Back end " + balancer.backend(i).description() +
+ debugmsg("Back end " +
+ balancer.backend(i).description() +
" forbidden due to urlmatch\n");
url_allowed = false;
}
|
[-]
[+]
|
Changed |
crossroads-devel.tar.gz/xr/backend/connect.cc
^
|
@@ -6,7 +6,7 @@
// Assume the backend is dead
islive = false;
- debugmsg ("Connecting to back end " + description() + "\n");
+ debugmsg ("About to connect to back end " + description() + "\n");
// Create client socket
if ( (clsocket = socket (PF_INET, SOCK_STREAM, 0)) < 0 )
@@ -54,18 +54,22 @@
fdset.add (clsocket);
fdset.wait_rw();
- debugmsg(Mstr("Connectiong to ") + description() + "\n");
+ debugmsg(Mstr("Connecting to ") + description() + "\n");
# ifdef CONNECTCHECK_ONLY_WRITABLE
if (fdset.writeable(clsocket))
islive = true;
- else
+ else {
markconnecterror();
+ socketclose(clsocket);
+ }
# else
if (fdset.writeable(clsocket) && !fdset.readable(clsocket))
islive = true;
- else
+ else {
+ socketclose(clsocket);
markconnecterror();
+ }
# endif
}
|
[-]
[+]
|
Changed |
crossroads-devel.tar.gz/xr/balancer/balancer
^
|
@@ -50,6 +50,7 @@
bool term;
bool rep;
bool rest;
+ Webinterface *webinterface;
};
extern Balancer balancer;
|
[-]
[+]
|
Changed |
crossroads-devel.tar.gz/xr/balancer/balancer1.cc
^
|
@@ -2,5 +2,5 @@
Balancer::Balancer () :
server_fd(-1), request_nr(0), backends(),
- term(false), rep(false), rest(false) {
+ term(false), rep(false), rest(false), webinterface(0) {
}
|
[-]
[+]
|
Changed |
crossroads-devel.tar.gz/xr/balancer/init.cc
^
|
@@ -15,10 +15,10 @@
// Start the web interface if requested.
if (config.usewebinterface() && !config.foregroundmode()) {
- Webinterface *w = new Webinterface();
- if (! w)
+ webinterface = new Webinterface();
+ if (! webinterface)
throw Error("Memory fault in Balancer::init");
- w->start();
+ webinterface->start();
}
// Add workable back ends, display initial states.
|
[-]
[+]
|
Changed |
crossroads-devel.tar.gz/xr/balancer/serve.cc
^
|
@@ -198,6 +198,7 @@
// Wait for running threads to die off.
socketclose (server_fd);
+ delete webinterface;
unsigned prev_conn = 0x19081962;
while (1) {
unsigned curr_conn = balancer.connections();
|
[-]
[+]
|
Changed |
crossroads-devel.tar.gz/xr/sys/main.cc
^
|
@@ -56,16 +56,9 @@
* web interface. */
balancer.report(true);
break;
- case SIGPIPE:
- case SIGSTOP:
- /* SIGPIPE is ignored (See below). Leaving in place for future
- * versions. SIGSTOP is used for stopping separarte treads. */
+ default:
balancer.terminate(true);
break;
- case SIGSEGV:
- /* Production-grade protection - don't ever crash! */
- balancer.restart(true);
- break;
}
}
@@ -75,7 +68,6 @@
static int relevant_sig[] = {
SIGHUP, SIGINT, SIGQUIT, SIGABRT, SIGTERM, SIGSTOP,
- // SIGSEGV
};
try {
|
[-]
[+]
|
Changed |
crossroads-devel.tar.gz/xr/webinterface/answer.cc
^
|
@@ -1,4 +1,5 @@
#include "webinterface"
+#include "balancer/balancer"
static void stop_backend_thread(pthread_t id) {
Threadinfo info = Threadlist::info(id);
|
[-]
[+]
|
Changed |
crossroads-devel.tar.gz/xr/webinterface/answerstatus.cc
^
|
@@ -1,4 +1,5 @@
#include "webinterface"
+#include "balancer/balancer"
void Webinterface::answer_status() {
string xml =
|
[-]
[+]
|
Changed |
crossroads-devel.tar.gz/xr/webinterface/execute.cc
^
|
@@ -1,11 +1,14 @@
#include "webinterface"
+#include "balancer/balancer"
void Webinterface::execute() {
- int sfd;
-
Threadlist::desc("Web interface");
// Create the server socket, or retry infinitely.
+ // This is maybe a too big precaution - previous xr's are responsible
+ // for killing off their web interfaces. But we don't want a new xr
+ // start to croak and cause downtime just because the web interface,
+ // so we just retry for a bit.
while (true) {
try {
msg ("Starting web interface\n");
|
[-]
[+]
|
Changed |
crossroads-devel.tar.gz/xr/webinterface/webinterface
^
|
@@ -6,11 +6,13 @@
#include "ThreadsAndMutexes/threadlist/threadlist"
#include "fdset/fdset"
#include "httpbuffer/httpbuffer"
-#include "balancer/balancer"
class Webinterface: public Thread {
public:
+ Webinterface() { cfd = 0; sfd = 0; }
+ virtual ~Webinterface();
void execute();
+
private:
void serve();
void answer(Httpbuffer r);
@@ -19,7 +21,7 @@
void answer_blob (string const &b);
- int cfd;
+ int cfd, sfd;
};
#endif
|
[-]
[+]
|
Added |
crossroads-devel.tar.gz/xr/webinterface/webinterface1.cc
^
|
@@ -0,0 +1,8 @@
+#include "webinterface"
+
+Webinterface::~Webinterface() {
+ if (cfd) {
+ msg ((Mstr("Stopping web interface socket ") + sfd) + "\n");
+ socketclose(sfd);
+ }
+}
|
[-]
[+]
|
Changed |
crossroads-devel.tar.gz/xrctl/xrctl
^
|
@@ -464,16 +464,15 @@
sub xr_command {
my $service = shift;
my @parts = xr_cmdarr($service);
- msg ("Command: @parts\n");
+ msg ("Exec command: @parts\n");
my $ret = xfind_bin('xr');
for (my $i = 1; $i <= $#parts; $i++) {
my $sub = $parts[$i];
$sub =~ s/^\s+//;
$sub =~ s/\s+$//;
- $sub = "'$sub'" if ($sub =~ /\s/);
- $ret .= ' ' . $sub;
+ $ret .= ' ' . shquote($sub);
}
- msg ("Quoted command: $ret\n");
+ msg ("Shell command: $ret\n");
return ($ret);
}
@@ -650,6 +649,24 @@
return (@ret);
}
+# Shell-quote a string
+sub shquote($) {
+ my $s = shift;
+
+ return $s unless ($s =~ /[\(\)\'\"\| \*\[\]\^\$]/);
+
+ if ($s !~ /'/) {
+ $s = "'$s'";
+ } elsif ($s !~ /"/) {
+ $s = "\"$s\"";
+ } else {
+ $s =~ s/"/\\"/g;
+ $s = "\"$s\"";
+ }
+
+ return $s;
+}
+
# Prepare a flag for the command line if it is defined and if it is
# not equal to the default
sub flag {
|