]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Call haveParsedReplyHeaders() before entry->replaceHttpReply().
authorAlex Rousskov <rousskov@measurement-factory.com>
Thu, 14 Apr 2011 22:20:55 +0000 (16:20 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Thu, 14 Apr 2011 22:20:55 +0000 (16:20 -0600)
HaveParsedReplyHeaders() sets the entry public key and various flags (at
least). ReplaceHttpReply() packs reply headers, starting swapout process.
It feels natural to adjust the entry _before_ we pack/swap it, but I may be
missing some side-effects here.

The change was necessary because we started calling checkCachable() from
swapoutPossible(). If haveParsedReplyHeaders() is not called before we swap
out checks, the entry will still have the private key and will be declared
impossible to cache.

src/Server.cc

index ef6f8abdb8ec00e6ddea7a708e70e0f2fd179ac3..5baf389a1eba2416f67401f21d595e94dd8a976c 100644 (file)
@@ -162,8 +162,8 @@ ServerStateData::setFinalReply(HttpReply *rep)
     assert(rep);
     theFinalReply = HTTPMSGLOCK(rep);
 
-    entry->replaceHttpReply(theFinalReply);
     haveParsedReplyHeaders();
+    entry->replaceHttpReply(theFinalReply);
 
     return theFinalReply;
 }