]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix "store_status == STORE_PENDING" assertion in FTP with large responses
authorwessels <>
Mon, 23 Apr 2007 13:29:57 +0000 (13:29 +0000)
committerwessels <>
Mon, 23 Apr 2007 13:29:57 +0000 (13:29 +0000)
An FTP object that exceeds reply_body_max_size leads to an assertion
failure.  The StoreEntry is aborted by the call to appendSuccessHeader(),
but the abort callback is delayed due to using events.  We need to
check for ENTRY_ABORTED (again) right after the appendSuccessHeader()
call -- yuck.

src/ftp.cc

index e3abb61225757b06c3c782d8ab0a0bfbbfa87c99..302b14aebcb21b5bf5cec08dfc334d3d93107bbb 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ftp.cc,v 1.414 2007/04/21 07:14:14 wessels Exp $
+ * $Id: ftp.cc,v 1.415 2007/04/23 07:29:57 wessels Exp $
  *
  * DEBUG: section 9     File Transfer Protocol (FTP)
  * AUTHOR: Harvest Derived
@@ -1323,6 +1323,15 @@ FtpStateData::processReplyBody()
     if (!flags.http_header_sent && data.readBuf->contentSize() >= 0)
         appendSuccessHeader();
 
+    if (EBIT_TEST(entry->flags, ENTRY_ABORTED)) {
+       /*
+        * probably was aborted because content length exceeds one
+        * of the maximum size limits.
+        */
+        abortTransaction("entry aborted after calling appendSuccessHeader()");
+        return;
+    }
+
 #if ICAP_CLIENT
 
     if (icapAccessCheckPending) {