From: hno <> Date: Wed, 3 May 2000 02:28:29 +0000 (+0000) Subject: hno squid-2.3.DEVEL3.httpd_accel_single_host-2.patch X-Git-Tag: SQUID_3_0_PRE1~2008 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=13c7936a017d7551426f84173e2145d6d987cb54;p=thirdparty%2Fsquid.git hno squid-2.3.DEVEL3.httpd_accel_single_host-2.patch Squid-2.3.DEVEL3: httpd_accel_single_host Added simplified support for running Squid as a accelerator in front of a single server with multiple domains/sites. --- diff --git a/ChangeLog b/ChangeLog index 421f6770b7..b6826e001d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -45,6 +45,7 @@ Changes to Squid-2.4.DEVEL3 (): - Squid no longer tries to do Range internally if it is not supported by the origin server. Doing so could cause bandwidth spikes and/or negative hit ratio. + - httpd_accel_single_host squid.conf directive Changes to Squid-2.4.DEVEL2 (): diff --git a/src/cf.data.pre b/src/cf.data.pre index 34138e4915..f6e3bcbc1e 100644 --- a/src/cf.data.pre +++ b/src/cf.data.pre @@ -1,6 +1,6 @@ # -# $Id: cf.data.pre,v 1.173 2000/05/02 19:58:13 hno Exp $ +# $Id: cf.data.pre,v 1.174 2000/05/02 20:28:30 hno Exp $ # # # SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -2020,6 +2020,26 @@ httpd_accel_host hostname httpd_accel_port port DOC_END +NAME: httpd_accel_single_host +COMMENT: on|off +TYPE: onoff +LOC: Config.Accel.single_host +DEFAULT: on +DOC_START + If you are running Squid as a accelerator and have a single backend + server then set this to on. This causes Squid to forward the request + to this server irregardles of what any redirectors or Host headers + says. + + Set this to off if you have multiple backend servers, and use a + redirector (or host table) to map the requests to the + appropriate backend servers. Note that the mapping needs to be a + 1-1 mapping between requested and backend (from redirector) domain + names or caching will fail, as cacing is performed using the + URL returned from the redirector. + + See also redirect_rewrites_host_header. +DOC_END NAME: httpd_accel_with_proxy COMMENT: on|off diff --git a/src/forward.cc b/src/forward.cc index 01a40c3eee..977c0da651 100644 --- a/src/forward.cc +++ b/src/forward.cc @@ -1,6 +1,6 @@ /* - * $Id: forward.cc,v 1.71 2000/05/02 19:35:23 hno Exp $ + * $Id: forward.cc,v 1.72 2000/05/02 20:28:30 hno Exp $ * * DEBUG: section 17 Request Forwarding * AUTHOR: Duane Wessels @@ -250,6 +250,11 @@ fwdConnectStart(void *data) port = fs->peer->http_port; ctimeout = fs->peer->connect_timeout > 0 ? fs->peer->connect_timeout : Config.Timeout.peer_connect; + } else if (fwdState->request->flags.accelerated && + Config.Accel.single_host && Config.Accel.host) { + host = Config.Accel.host; + port = Config.Accel.port; + ctimeout = Config.Timeout.connect; } else { host = fwdState->request->host; port = fwdState->request->port; diff --git a/src/structs.h b/src/structs.h index 60ac6552fb..214508a3ae 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.321 2000/05/02 19:35:24 hno Exp $ + * $Id: structs.h,v 1.322 2000/05/02 20:28:30 hno Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -324,6 +324,7 @@ struct _SquidConfig { int authenticateTTL; int authenticateIpTTL; struct { + int single_host; char *host; u_short port; } Accel;