]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
persistent connection / content-length fix. We may not get a
authorwessels <>
Mon, 1 Dec 1997 09:19:19 +0000 (09:19 +0000)
committerwessels <>
Mon, 1 Dec 1997 09:19:19 +0000 (09:19 +0000)
content-length on non-200 replies.  In this case, we are DONE writing
to the client when we have seen the end of the reply headers.

src/client_side.cc

index 944efce14a5f3d289f9bc1c0f441866a91e45016..bdb65f1151d739ddb383e1f3abd3b67bf422341e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.161 1997/11/30 04:00:53 wessels Exp $
+ * $Id: client_side.cc,v 1.162 1997/12/01 02:19:19 wessels Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -1775,8 +1775,17 @@ icpCheckTransferDone(clientHttpRequest * http)
            return 1;
     if ((mem = entry->mem_obj) == NULL)
        return 0;
-    if (mem->reply->content_length < 0)
-       return 0;
+    if (mem->reply->content_length < 0) {
+       /*
+        * reply->hdr_sz will be set by httpParseReplyHeaders()
+        * if we find the end of the headers.  If we find the end,
+        * and there is no content length, stick a fork in us. 
+        */
+       if (mem->reply->hdr_sz > 0)
+           return 1;
+       else
+           return 0;
+    }
     if (http->out.offset >= mem->reply->content_length + mem->reply->hdr_sz)
        return 1;
     return 0;