]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3177: assertion failed: comm.cc:1583: "fd >= 0"
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 18 Mar 2011 12:44:47 +0000 (01:44 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 18 Mar 2011 12:44:47 +0000 (01:44 +1300)
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

index 64f883a080d1bbcaa1f749b939b92a7f6bcd1aa3..d97b0df2dbefb1c44e3986fc8ee54e464c80ac4e 100644 (file)
@@ -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();