From: Dmitry Kurochkin Date: Wed, 29 Jun 2011 05:59:07 +0000 (+0400) Subject: Always call processReplyBody() after adaptOrFinalizeReply(). X-Git-Tag: take07~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ef85ab2f777c5d44cd2d6d769b4bda47e821f170;p=thirdparty%2Fsquid.git Always call processReplyBody() after adaptOrFinalizeReply(). The recent fix for "store_status == STORE_PENDING" added a check with return from HttpStateData::processReply() before processReplyBody() call. But processReplyBody() does proper server state cleanup. We could end up with server state that would not be cleaned (until connection is closed). That could also introduce other issues. The patch moves the isAccepting() check from processReply() to processReplyBody(). We do not write to an entry that is not accepting, but allow processReplyBody() to do proper cleanup. --- diff --git a/src/http.cc b/src/http.cc index a6c849a40d..7906274836 100644 --- a/src/http.cc +++ b/src/http.cc @@ -1209,8 +1209,6 @@ HttpStateData::processReply() return; // TODO: send errors to ICAP adaptOrFinalizeReply(); // may write to, abort, or "close" the entry - if (!entry->isAccepting()) - return; } // kick more reads if needed and/or process the response body, if any @@ -1380,14 +1378,16 @@ HttpStateData::processReplyBody() * That means header content has been removed from readBuf and * it contains only body data. */ - if (flags.chunked) { - if (!decodeAndWriteReplyBody()) { - flags.do_next_read = 0; - serverComplete(); - return; - } - } else - writeReplyBody(); + if (entry->isAccepting()) { + if (flags.chunked) { + if (!decodeAndWriteReplyBody()) { + flags.do_next_read = 0; + serverComplete(); + return; + } + } else + writeReplyBody(); + } if (EBIT_TEST(entry->flags, ENTRY_ABORTED)) { /*