]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
hno squid-2.3.DEVEL3.httpd_accel_single_host-2.patch
authorhno <>
Wed, 3 May 2000 02:28:29 +0000 (02:28 +0000)
committerhno <>
Wed, 3 May 2000 02:28:29 +0000 (02:28 +0000)
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.

ChangeLog
src/cf.data.pre
src/forward.cc
src/structs.h

index 421f6770b7925207b4f7a4576d43099e42d39671..b6826e001d5db3832dbe1143d6d842452c67fefe 100644 (file)
--- 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 ():
 
index 34138e4915f35dbeb4a325840beab992a6038bfa..f6e3bcbc1e9375b4d375ee88c3dc648edb5bcba1 100644 (file)
@@ -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
index 01a40c3eee3e7caed3f2a1b1c4926e9020ee16e4..977c0da65174eaf00b4b059a7efe14f113a614d9 100644 (file)
@@ -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;
index 60ac6552fb7d2544174b937d74e7c60c2cb601f9..214508a3ae726a62226f6647d7578bc64d53b412 100644 (file)
@@ -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;