From 6b3133be7936606acd9f76830819699113c5c3b3 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Sat, 19 Mar 2011 01:44:47 +1300 Subject: [PATCH] Bug 3177: assertion failed: comm.cc:1583: "fd >= 0" This is a fix for the crash. There is a deeper TCP connection problem which leads to it. see bug report for details. --- src/ftp.cc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/ftp.cc b/src/ftp.cc index 64f883a080..d97b0df2db 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -3083,6 +3083,14 @@ void FtpStateData::ftpAcceptDataConnection(const CommAcceptCbParams &io) return; } + if (io.flag != COMM_OK) { + data.close(); + debugs(9, DBG_IMPORTANT, "FTP AcceptDataConnection: FD " << io.fd << ": " << xstrerr(io.xerrno)); + /** \todo Need to send error message on control channel*/ + ftpFail(this); + return; + } + /** \par * When squid.conf ftp_sanitycheck is enabled, check the new connection is actually being * made by the remote client which is connected to the FTP control socket. @@ -3106,13 +3114,6 @@ void FtpStateData::ftpAcceptDataConnection(const CommAcceptCbParams &io) } } - if (io.flag != COMM_OK) { - debugs(9, DBG_IMPORTANT, "ftpHandleDataAccept: comm_accept(" << io.nfd << "): " << xstrerr(io.xerrno)); - /** \todo XXX Need to set error message */ - ftpFail(this); - return; - } - /**\par * Replace the Listen socket with the accepted data socket */ data.close(); -- 2.47.2