From: Amos Jeffries Date: Sat, 9 Feb 2013 06:38:09 +0000 (-0700) Subject: Bug 3515: crash in FtpStateData::ftpTimeout X-Git-Tag: SQUID_3_2_8~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4943b08c77183b60f7a76c10c200019143e8faa;p=thirdparty%2Fsquid.git 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. --- 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);