Re: IE 4 && HTTP/1.1 through proxy [patch]

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Wed, 24 Nov 1999 21:51:19 +0100

Thanks for showing me the correct lokation of one part of the bug.

The bug was in that Squid no longer sends a content-length header on
IMS-HIT replies (as per RFC2616), and this caused the reply validity
check below to fail. Squid-2.2 patch attached.

--
Henrik Nordstrom
Squid hacker
T. Esting wrote:
> 
>   Just a little more follow-up...
> 
> src/client_side.c reads:
> 
>     /*
>      * Clear keepalive for NON-HEAD requests with invalid content length
>      */
>     if (request->method != METHOD_HEAD)
>         if (http->entry->mem_obj->reply->content_length < 0)
>             request->flags.proxy_keepalive = 0;
>     /* Signal keep-alive if needed */
>     httpHeaderPutStr(hdr,
>         http->flags.accel ? HDR_CONNECTION : HDR_PROXY_CONNECTION,
>         request->flags.proxy_keepalive ? "keep-alive" : "close");
> 
> What should ...reply->content_length be for a TCP_IMS_HIT reply?
> 
> ________________________________________________________________
> Get FREE voicemail, fax and email at http://voicemail.excite.com
> Talk online at http://voicechat.excite.com

Wed Nov 24 22:19:16 CET 1999
Modified Files in squid/src
        client_side.c

Oum.. there were more to it than I first thought. Not even HEAD worked as
it should.

-----------------------------------------------------------------

Wed Nov 24 21:48:42 CET 1999
Modified Files in squid/src
        client_side.c

Squid unintentionally denied persistent connections on IMS-HIT replies.

Index: squid/src/client_side.c
diff -u squid/src/client_side.c:1.1.1.45.2.10 squid/src/client_side.c:1.1.1.45.2.12
--- squid/src/client_side.c:1.1.1.45.2.10 Sun Nov 7 14:53:58 1999
+++ squid/src/client_side.c Wed Nov 24 22:19:14 1999
@@ -1147,11 +1147,13 @@
         getMyHostname(), Config.Port.http->port);
 #endif
     /*
- * Clear keepalive for NON-HEAD requests with invalid content length
+ * Clear keepalive unless there is a valid content length or
+ * if the reply type only has headers (HEAD or IMS).
      */
- if (request->method != METHOD_HEAD)
- if (http->entry->mem_obj->reply->content_length < 0)
- request->flags.proxy_keepalive = 0;
+ if (http->entry->mem_obj->reply->content_length < 0)
+ if (request->method != METHOD_HEAD)
+ if (http->entry->mem_obj->reply->sline.status != HTTP_NOT_MODIFIED )
+ request->flags.proxy_keepalive = 0;
     /* Signal keep-alive if needed */
     httpHeaderPutStr(hdr,
         http->flags.accel ? HDR_CONNECTION : HDR_PROXY_CONNECTION,
@@ -1662,7 +1664,12 @@
     } else if ((done = clientCheckTransferDone(http)) != 0 || size == 0) {
         debug(33, 5) ("clientWriteComplete: FD %d transfer is DONE\n", fd);
         /* We're finished case */
- if (http->entry->mem_obj->reply->content_length < 0) {
+ if (http->request->flags.proxy_keepalive && (
+ http->request->method == METHOD_HEAD ||
+ http->entry->mem_obj->reply->sline.status == HTTP_NOT_MODIFIED)) {
+ debug(33, 5) ("clientWriteComplete: FD %d Keeping Alive\n", fd);
+ clientKeepaliveNextRequest(http);
+ } else if (http->entry->mem_obj->reply->content_length < 0) {
             debug(33, 5) ("clientWriteComplete: closing, content_length < 0\n");
             comm_close(fd);
         } else if (!done) {
Received on Wed Nov 24 1999 - 14:56:47 MST

This archive was generated by hypermail pre-2.1.9 : Wed Apr 09 2008 - 11:57:32 MDT