crossroads

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

commit 81d8ce853248fd48a9166d81b7f40dbb1c820ea3
parent eb9f7be999fe95ff84b42f8d82314bb4d03314a7
Author: finwo <finwo@pm.me>
Date:   Sat,  3 Jan 2026 19:39:36 +0100

2.80

Diffstat:
MChangeLog | 8+++++++-
MMakefile | 2+-
Mxr/Dispatchers/httpdispatcher/handle.cc | 19++++++++++++-------
Mxr/etc/c-conf | 7++++++-
Mxr/netbuffer/netwrite.cc | 2+-
5 files changed, 27 insertions(+), 11 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,8 +1,14 @@ +2.80 [KK 2013-03-15] +- Upped to c-conf 1.17 (Ubuntu 64bits libs). +- When replacing Host: headers with the back end address, the port is + also appended. See flag -I / --replace-host-header. Thanks Nuno F. + for the patch. + 2.79 [KK 2012-04-19] - Bugfix in the web interface network handling. 2.78 [KK 2012-04-18] -- xrctl fixes, thanks Carlos H. for reporting! +- xrctl fixes, thanks Carlos H. for reporting. 2.77 [KK 2012-02-16] - gc++ 4.6 portability issues diff --git a/Makefile b/Makefile @@ -1,7 +1,7 @@ # Top-level Makefile for XR # ------------------------- -VER ?= 2.79 +VER ?= 2.80 PREFIX ?= $(DESTDIR)/usr BINDIR ?= $(PREFIX)/sbin MANDIR ?= $(PREFIX)/share/man diff --git a/xr/Dispatchers/httpdispatcher/handle.cc b/xr/Dispatchers/httpdispatcher/handle.cc @@ -14,9 +14,12 @@ void HttpDispatcher::handle() { buf().setheader (config.serverheader(n)); // Patch up the Host: header if requested so. - if (config.replacehostheader()) - buf().replaceheader("Host:", - balancer.backend(targetbackend()).server()); + if (config.replacehostheader()) { + ostringstream o; + o << balancer.backend(targetbackend()).server() + << ":" << balancer.backend(targetbackend()).port(); + buf().replaceheader("Host:", o.str()); + } // Flush client info received so far to the back end. debugmsg("Sending client request to back end\n"); @@ -90,10 +93,12 @@ void HttpDispatcher::handle() { othersock = backendfd(); timeout = config.backend_write_timeout(); // Re-patch Host header if requested - if (config.replacehostheader()) - buf().replaceheader("Host:", - balancer.backend(targetbackend()) - .server()); + if (config.replacehostheader()) { + ostringstream o; + o << balancer.backend(targetbackend()).server() + << ":" << balancer.backend(targetbackend()).port(); + buf().replaceheader("Host:", o.str()); + } } else { othersock = clientfd(); timeout = config.client_write_timeout(); diff --git a/xr/etc/c-conf b/xr/etc/c-conf @@ -4,7 +4,10 @@ use strict; use Getopt::Std; # Globals -my $VER = "1.15"; +my $VER = "1.17"; +# 1.17 [KK 2013-03-15] /lib/x86_64-linux-gnu added for Ubuntu +# 1.16 [KK 2011-10-10] /usr/lib/x86_64-linux-gnu added to the libdirs for +# Ubuntu 11 64-bits. # 1.15 [KK 2008-10-12] Option "optflags" implemented. # 1.14 [KK 2008-08-22] c-compiler and c++-compiler attempt to find by # version, eg. '/opt/local/bin/g++-mp-4.2' is better @@ -38,6 +41,8 @@ my @def_headerdirs = ('/usr/include', ); my @def_libdirs = ('/usr/lib', '/usr/lib64', + '/lib/x86_64-linux-gnu', + '/usr/lib/x86_64-linux-gnu', '/usr/local/lib', '/usr/local/lib64', '/opt/local/lib', diff --git a/xr/netbuffer/netwrite.cc b/xr/netbuffer/netwrite.cc @@ -5,7 +5,7 @@ unsigned Netbuffer::netwrite (Socket &s, unsigned timeout) const { PROFILE("Netbuffer::netwrite"); - debugmsg("About to write " << buf_sz << " buytes to fd " << s.fd() + debugmsg("About to write " << buf_sz << " bytes to fd " << s.fd() << ", timeout " << timeout << '\n'); if (!buf_sz)