]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Do not access-log chunked non-persistent responses with _ABORTED suffix.
authorAlex Rousskov <rousskov@measurement-factory.com>
Wed, 17 Aug 2016 23:11:56 +0000 (17:11 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Wed, 17 Aug 2016 23:11:56 +0000 (17:11 -0600)
The lack of Content-Length response header and STREAM_FAILED are not
closely related. ClientStreams should be capable of delivering complete
[chunked] responses without Content-Length header. If the peer response
was not chunked and lacked Content-Length, then we will return
STREAM_FAILED when false checkTransferDone() indicates that we did not
get everything yet but flags.complete forces us to stop sending.

src/client_side_reply.cc

index b5fbd88fa9edf1aad4b3ca619107d44f234d3767..550a207f740471b96f123b765ecd7be34331e976 100644 (file)
@@ -1262,13 +1262,6 @@ clientReplyContext::replyStatus()
         debugs(88, 5, "clientReplyStatus: transfer is DONE: " << done << flags.complete);
         /* Ok we're finished, but how? */
 
-        const int64_t expectedBodySize =
-            http->storeEntry()->getReply()->bodySize(http->request->method);
-        if (!http->request->flags.proxyKeepalive && expectedBodySize < 0) {
-            debugs(88, 5, "clientReplyStatus: closing, content_length < 0");
-            return STREAM_FAILED;
-        }
-
         if (EBIT_TEST(http->storeEntry()->flags, ENTRY_BAD_LENGTH)) {
             debugs(88, 5, "clientReplyStatus: truncated response body");
             return STREAM_UNPLANNED_COMPLETE;
@@ -1279,6 +1272,8 @@ clientReplyContext::replyStatus()
             return STREAM_FAILED;
         }
 
+        const int64_t expectedBodySize =
+            http->storeEntry()->getReply()->bodySize(http->request->method);
         if (expectedBodySize >= 0 && !http->gotEnough()) {
             debugs(88, 5, "clientReplyStatus: client didn't get all it expected");
             return STREAM_UNPLANNED_COMPLETE;