]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
We were erroneously assuming that non-200 replies would have a content-length
authorwessels <>
Sat, 3 Jan 1998 12:27:17 +0000 (12:27 +0000)
committerwessels <>
Sat, 3 Jan 1998 12:27:17 +0000 (12:27 +0000)
if there were a reply body.  RFC 2068 does not require this.  If there is
no content-length, then we can't have a persistent connection.

src/client_side.cc
src/http.cc

index 8c98f506503318c010c96743c831b4740d77763a..519577454eb2ba713b8b7d35f15a140533f58943 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.187 1998/01/02 18:09:20 wessels Exp $
+ * $Id: client_side.cc,v 1.188 1998/01/03 05:27:17 wessels Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -1887,12 +1887,12 @@ clientCheckTransferDone(clientHttpRequest * http)
        return 0;               /* haven't found end of headers yet */
     else if (reply->code == HTTP_OK)
        sending = SENDING_BODY;
-    else if (reply->content_length < 0)
-       sending = SENDING_HDRSONLY;
     else if (reply->code == HTTP_NO_CONTENT)
        sending = SENDING_HDRSONLY;
     else if (reply->code == HTTP_NOT_MODIFIED)
        sending = SENDING_HDRSONLY;
+    else if (reply->code < HTTP_OK)
+       sending = SENDING_HDRSONLY;
     else if (http->request->method == METHOD_HEAD)
        sending = SENDING_HDRSONLY;
     else
index 8973e7ff14b00581ea8577d8eb5aa871a2757659..41428db3f358c4cd1ccd6af477c951fe367a4a1b 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: http.cc,v 1.230 1997/12/07 00:48:14 wessels Exp $
+ * $Id: http.cc,v 1.231 1998/01/03 05:27:18 wessels Exp $
  *
  * DEBUG: section 11    Hypertext Transfer Protocol (HTTP)
  * AUTHOR: Harvest Derived
@@ -584,26 +584,26 @@ httpPconnTransferDone(HttpStateData * httpState)
      *    - If we haven't seen the end of the reply headers, we can't
      *      be persistent.
      *    - For "200 OK" check the content-length in the next block.
-     *    - For other replies without a content-length, we're done.
      *    - For "204 No Content" (even with content-length) we're done.
      *    - For "304 Not Modified" (even with content-length) we're done.
+     *    - 1XX replies never have a body; we're done.
      *    - For HEAD requests with content-length we're done.
-     *    - For other replies with a content length, we continue...
+     *    - For all other replies, check content length in next block.
      */
     if (httpState->reply_hdr_state < 2)
        return 0;
     else if (reply->code == HTTP_OK)
-       (void) 0;               /* continue */
-    else if (reply->content_length < 0)
-       return 1;
+       (void) 0;               /* common case, continue */
     else if (reply->code == HTTP_NO_CONTENT)
        return 1;
     else if (reply->code == HTTP_NOT_MODIFIED)
        return 1;
+    else if (reply->code < HTTP_OK)
+       return 1;
     else if (httpState->request->method == METHOD_HEAD)
        return 1;
     /*
-     * If there is no content-length, then we probably can't be
+     * If there is no content-length, then we can't be
      * persistent.  If there is a content length, then we must
      * wait until we've seen the end of the body.
      */