]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Always call processReplyBody() after adaptOrFinalizeReply().
authorDmitry Kurochkin <dmitry.kurochkin@measurement-factory.com>
Wed, 29 Jun 2011 05:59:07 +0000 (09:59 +0400)
committerDmitry Kurochkin <dmitry.kurochkin@measurement-factory.com>
Wed, 29 Jun 2011 05:59:07 +0000 (09:59 +0400)
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.

src/http.cc

index a6c849a40d98b9493fec936c90a530f9c5315f7c..7906274836318b9b0b802520dc14c461dead5ff4 100644 (file)
@@ -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)) {
         /*