From: Alex Rousskov Date: Wed, 17 Aug 2016 23:11:56 +0000 (-0600) Subject: Do not access-log chunked non-persistent responses with _ABORTED suffix. X-Git-Tag: SQUID_4_0_14~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14231db9d82081aaeb57d746bdebf6258335e022;p=thirdparty%2Fsquid.git Do not access-log chunked non-persistent responses with _ABORTED suffix. 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. --- diff --git a/src/client_side_reply.cc b/src/client_side_reply.cc index b5fbd88fa9..550a207f74 100644 --- a/src/client_side_reply.cc +++ b/src/client_side_reply.cc @@ -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;