Re: accelerator and squid-2.2.STABLE5.ignore_host_header.patch

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Thu, 16 Dec 1999 11:57:40 +0100

Miquel van Smoorenburg wrote:

> httpd_accel_uses_host_header means that the accelerator uses the Host:
> header to find out what site to accelerate. I don't want that. I
> want it to use httpd_accel_host only.

Won't work. Squid NEEDS to know the site to be able to cache it
properly, or else it will cache all requests as belonging to one single
site (the httpd_accel_host site).

> I guess what I want is something in between, I want squid to use
> httpd_accel_uses_host_header AND httpd_accel_host 195.64.65.21.
> Hmm, so that functionality doesn't exist yet, right ? Okay ...

Right.

The "acceleration" is done early in the input chain, where Squid
reconstructs the absolute URL of the request. It is then being handled
identical to how it proxies requests.

Implementing what you want should be quite trivial however. Something
like the following ought to do it (in fwdConnectStart):

--- forward.c 1999/10/30 20:30:08 1.1.1.17.2.2
+++ forward.c 1999/12/16 10:54:46
@@ -242,8 +242,13 @@
        ctimeout = fs->peer->connect_timeout > 0 ?
fs->peer->connect_timeout
            : Config.Timeout.peer_connect;
     } else {
+ if (fwdState->request->flags.accelerated) {
+ host = Config.Accel.host;
+ port = Config.Accel.port;
+ } else {
        host = fwdState->request->host;
        port = fwdState->request->port;
+ }
        ctimeout = Config.Timeout.connect;
     }
     if ((fd = pconnPop(host, port)) >= 0) {

/Henrik
Received on Thu Dec 16 1999 - 04:07:42 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:49:55 MST