]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Author: Christos Tsantilas <chtsanti@users.sourceforge.net>
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 2 Feb 2009 09:43:27 +0000 (22:43 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 2 Feb 2009 09:43:27 +0000 (22:43 +1300)
Bug 2524: Connection close failed on Partial Content

The method ClientSocketContext::socketState in the case of partial content
request when all the expected bytes received and the proxy_keepalive flag is
not set must return STREAM_UNPLANNED_COMPLETE to inform the caller that the
socket should closed.

src/client_side.cc

index e50a8d8bacd527f682169132f1ffcb3aff305f06..2dd1a45e624170e718b28dd1e4e649b33d3e1916 100644 (file)
@@ -1551,8 +1551,12 @@ ClientSocketContext::socketState()
 
             // did we get at least what we expected, based on range specs?
 
-            if (bytesSent == bytesExpected) // got everything
-                return STREAM_COMPLETE;
+            if (bytesSent == bytesExpected) { // got everything
+                if (http->request->flags.proxy_keepalive)
+                    return STREAM_COMPLETE;
+                else
+                    return STREAM_UNPLANNED_COMPLETE;
+            }
 
             // The logic below is not clear: If we got more than we
             // expected why would persistency matter? Should not this