/*
- * $Id: ftp.cc,v 1.338 2003/01/23 00:37:21 robertc Exp $
+ * $Id: ftp.cc,v 1.339 2003/02/01 13:38:44 hno Exp $
*
* DEBUG: section 9 File Transfer Protocol (FTP)
* AUTHOR: Harvest Derived
static void
ftpStateFree(int fdnotused, void *data)
+{
+ FtpStateData *ftpState = (FtpStateData *)data;
+ cbdataFree(ftpState);
+}
+
+static void
+ftpStateFreed(void *data)
{
FtpStateData *ftpState = (FtpStateData *)data;
if (ftpState == NULL)
comm_close(ftpState->data.fd);
ftpState->data.fd = -1;
}
- cbdataFree(ftpState);
}
static void
FtpStateData *ftpState;
HttpReply *reply;
- CBDATA_INIT_TYPE(FtpStateData);
+ CBDATA_INIT_TYPE_FREECB(FtpStateData, ftpStateFreed);
ftpState = cbdataAlloc(FtpStateData);
debug(9, 3) ("ftpStart: '%s'\n", url);
statCounter.server.all.requests++;
* to delete the close handler which did NOT get called
* to prevent ftpStateFree() getting called twice.
* Instead we'll always call comm_close() on the ctrl FD.
+ *
+ * XXX this should not actually matter if the ftpState is cbdata
+ * managed correctly and comm close handlers are cbdata fenced
*/
ftpState->data.fd = fd;
snprintf(cbuf, 1024, "PASV\r\n");