From f4943b08c77183b60f7a76c10c200019143e8faa Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Fri, 8 Feb 2013 23:38:09 -0700 Subject: [PATCH] Bug 3515: crash in FtpStateData::ftpTimeout Since revision squid-3.2-11174 restructured teh TCO connection handling in FTP the data connection has had separate 'opener' connection. Meaning the conn->fd state is always NULL when the setup times out. This cleans up the data connection opener state and allows the error message generation to take place. --- src/ftp.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ftp.cc b/src/ftp.cc index e0c1d37ec8..29ea45a416 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -673,10 +673,17 @@ FtpStateData::ftpTimeout(const CommTimeoutCbParams &io) if (abortOnBadEntry("entry went bad while waiting for a timeout")) return; - if (SENT_PASV == state && io.conn->fd == data.conn->fd) { - /* stupid ftp.netscape.com */ + if (SENT_PASV == state) { + /* stupid ftp.netscape.com, of FTP server behind stupid firewall rules */ flags.pasv_supported = false; debugs(9, DBG_IMPORTANT, "ftpTimeout: timeout in SENT_PASV state" ); + + // cancel the data connection setup. + if (data.opener != NULL) { + data.opener->cancel("timeout"); + data.opener = NULL; + } + data.close(); } failed(ERR_READ_TIMEOUT, 0); -- 2.47.2