From 35f269984076c6649d5fed3e52592b60c2671e6b Mon Sep 17 00:00:00 2001 From: wessels <> Date: Mon, 23 Apr 2007 13:29:57 +0000 Subject: [PATCH] Fix "store_status == STORE_PENDING" assertion in FTP with large responses 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 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ftp.cc b/src/ftp.cc index e3abb61225..302b14aebc 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -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) { -- 2.47.2