Re: Puzzled about persistent connection reuse

From: Duane Wessels <wessels@dont-contact.us>
Date: Wed, 30 Jul 2003 10:18:53 -0600 (MDT)

On Wed, 30 Jul 2003, Kinkie wrote:

> Kinkie <kinkie-dev@kinkie.it> writes:
>
> > Duane Wessels <wessels@squid-cache.org> writes:
>
> Ok, got it.
>
> The setup is:
>
>
> httpd_accel_host 1.2.3.4
> httpd_accel_port 81
> httpd_accel_single_host on
> http_port 80
>
>
> Notice that httpd_accel_host is set to an IP address,
>
> pconnPush apparently uses as key to store the persistent connection the
> virtual host name as set by the client. But then in pconnPop the
> httpd_accel_host is used. Unless clients use the ip address to access the
> site and not its dns name, the two keys will never match, and thus pconns
> will never be reused.

Ah. This should fix it:

Index: http.c
===================================================================
RCS file: /server/cvs-server/squid/squid/src/http.c,v
retrieving revision 1.384.2.7
diff -u -3 -p -r1.384.2.7 http.c
--- http.c 15 Jul 2003 20:16:12 -0000 1.384.2.7
+++ http.c 30 Jul 2003 16:17:58 -0000
@@ -657,7 +657,11 @@ httpReadReply(int fd, void *data)
 #endif
            comm_remove_close_handler(fd, httpStateFree, httpState);
            fwdUnregister(fd, httpState->fwd);
- pconnPush(fd, request->host, request->port);
+ if (request->flags.accelerated &&
+ Config.Accel.single_host && Config.Accel.host)
+ pconnPush(fd, Config.Accel.host, Config.Accel.port);
+ else
+ pconnPush(fd, request->host, request->port);
            fwdComplete(httpState->fwd);
            httpState->fd = -1;
            httpStateFree(fd, httpState);
Received on Wed Jul 30 2003 - 10:18:58 MDT

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