]> 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)
committerAmos Jeffries <yadij@users.noreply.github.com>
Sun, 19 Jan 2020 08:56:48 +0000 (21:56 +1300)
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 6243b491016905cf20feed308230eeb329ce9168..6521f17d4c8394e629f9ff0794af849ad89af9f2 100644 (file)
@@ -1493,6 +1493,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;
         }