]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3346: forward.cc:364: "entry->store_status == STORE_PENDING"
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Mon, 3 Oct 2011 10:17:42 +0000 (13:17 +0300)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Mon, 3 Oct 2011 10:17:42 +0000 (13:17 +0300)
While the server writes the response to Store, the client side may
synchronously abort the entry. This happens, for example, when the
server receives a 304 response and handleIMSReply calls
sendClientOldEntry, which calls storeUnregister with our entry,
resulting in CheckQuickAbort.

Once server store write returns, if the server is done, it calls
FwdState::completed(). At that time, the server does not know that (and
should not care whether) the entry was aborted. Thus, we need to handle
aborted entries in FwdState::completed.

This is a Measurement Factory project.

src/forward.cc

index cbada6fa16485bf234004ea27290be30bb036fad..cb52ffa612385ab24493e8e47cf5feaf549e4e20 100644 (file)
@@ -146,6 +146,11 @@ FwdState::completed()
 
     flags.forward_completed = 1;
 
+    if (EBIT_TEST(entry->flags, ENTRY_ABORTED)) {
+        debugs(17, 3, HERE << "entry aborted");
+        return ;
+    }
+
 #if URL_CHECKSUM_DEBUG
 
     entry->mem_obj->checkUrlChecksum();
@@ -361,7 +366,6 @@ FwdState::unregister(int fd)
 void
 FwdState::complete()
 {
-    assert(entry->store_status == STORE_PENDING);
     debugs(17, 3, HERE << entry->url() << "\n\tstatus " << entry->getReply()->sline.status  );
 #if URL_CHECKSUM_DEBUG
 
@@ -1017,6 +1021,12 @@ FwdState::reforward()
 {
     StoreEntry *e = entry;
     http_status s;
+
+    if (EBIT_TEST(e->flags, ENTRY_ABORTED)) {
+        debugs(17, 3, HERE << "entry aborted");
+        return 0;
+    }
+
     assert(e->store_status == STORE_PENDING);
     assert(e->mem_obj);
 #if URL_CHECKSUM_DEBUG