]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 4735: Truncated chunked responses cached as whole (#528)
authorDrDaveD <2129743+DrDaveD@users.noreply.github.com>
Mon, 30 Dec 2019 20:43:33 +0000 (20:43 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Wed, 1 Jan 2020 20:45:04 +0000 (20:45 +0000)
Mark responses received without the last chunk as responses that have
bad (and, hence, unknown) message body length (i.e. ENTRY_BAD_LENGTH).
If they were being cached, such responses will be released and will stop
being shareable.

src/http.cc

index 742cf65d434b66a24cf7ee44d24214d2e2aac59c..9c0601b0a645fbfb39c0e87fdc604172a55f97c8 100644 (file)
@@ -1505,6 +1505,9 @@ HttpStateData::processReplyBody()
 
         case COMPLETE_NONPERSISTENT_MSG:
             debugs(11, 5, "processReplyBody: COMPLETE_NONPERSISTENT_MSG from " << serverConnection);
+            if (flags.chunked && !lastChunk)
+                entry->lengthWentBad("missing last-chunk");
+
             serverComplete();
             return;
         }