]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Add comm_add_close_handler() for ftpState->data.fd. If the data socket
authorwessels <>
Thu, 1 Jan 1998 00:52:04 +0000 (00:52 +0000)
committerwessels <>
Thu, 1 Jan 1998 00:52:04 +0000 (00:52 +0000)
connection failed, then a comm_close() call was closing the data socket,
but not freeing up the ftpState.

src/ftp.cc

index 75415d6df6024ae59aafb6cff89523a4ce97e65f..c822b74eae1f34a0e56bcf14a5dc414a23e2d0c3 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ftp.cc,v 1.180 1997/12/06 05:16:56 wessels Exp $
+ * $Id: ftp.cc,v 1.181 1997/12/31 17:52:04 wessels Exp $
  *
  * DEBUG: section 9     File Transfer Protocol (FTP)
  * AUTHOR: Harvest Derived
@@ -1378,6 +1378,7 @@ ftpSendPasv(FtpStateData * ftpState)
        ftpFail(ftpState);
        return;
     }
+    comm_add_close_handler(fd, ftpStateFree, ftpState);
     ftpState->data.fd = fd;
     snprintf(cbuf, 1024, "PASV\r\n");
     ftpWriteCommand(cbuf, ftpState);
@@ -1403,7 +1404,7 @@ ftpReadPasv(FtpStateData * ftpState)
        return;
     }
     if (strlen(buf) > 1024) {
-       debug(9, 1) ("Avoiding potential buffer overflow\n");
+       debug(9, 1) ("ftpReadPasv: Avoiding potential buffer overflow\n");
        ftpSendPort(ftpState);
        return;
     }