Wed Dec 8 17:58:45 CET 1999 Modified Files in squid/src ftp.c Fix a assertion failure seen if the FTP server responds with a invalid PASV reply. ----------------------------------------------------------------- Index: squid/src/ftp.c diff -u squid/src/ftp.c:1.1.1.39.2.4 squid/src/ftp.c:1.1.1.39.2.5 --- squid/src/ftp.c:1.1.1.39.2.4 Thu Dec 2 22:52:35 1999 +++ squid/src/ftp.c Wed Dec 8 17:58:44 1999 @@ -1707,8 +1707,6 @@ debug(9, 3) ("This is ftpReadPasv\n"); if (code != 227) { debug(9, 3) ("PASV not supported by remote end\n"); - comm_close(ftpState->data.fd); - ftpState->data.fd = -1; ftpSendPort(ftpState); return; } @@ -1774,6 +1772,14 @@ int on = 1; u_short port = 0; /* + * Tear down any old data connection if any. We are about to + * establish a new one. + */ + if (ftpState->data.fd > 0) { + comm_close(ftpState->data.fd); + ftpState->data.fd = -1; + } + /* * Set up a listen socket on the same local address as the * control connection. */ @@ -1847,8 +1853,6 @@ if (code != 200) { /* Fall back on using the same port as the control connection */ debug(9, 3) ("PORT not supported by remote end\n"); - comm_close(ftpState->data.fd); - ftpState->data.fd = -1; ftpOpenListenSocket(ftpState, 1); } ftpRestOrList(ftpState);