From: Alex Rousskov Date: Thu, 14 Apr 2011 22:20:55 +0000 (-0600) Subject: Call haveParsedReplyHeaders() before entry->replaceHttpReply(). X-Git-Tag: take06~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=466d6f45f2c156639dea8979d19a479b8f9408e5;p=thirdparty%2Fsquid.git Call haveParsedReplyHeaders() before entry->replaceHttpReply(). 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. --- diff --git a/src/Server.cc b/src/Server.cc index ef6f8abdb8..5baf389a1e 100644 --- a/src/Server.cc +++ b/src/Server.cc @@ -162,8 +162,8 @@ ServerStateData::setFinalReply(HttpReply *rep) assert(rep); theFinalReply = HTTPMSGLOCK(rep); - entry->replaceHttpReply(theFinalReply); haveParsedReplyHeaders(); + entry->replaceHttpReply(theFinalReply); return theFinalReply; }