Index: squid/src/ftp.c diff -c squid/src/ftp.c:1.316.2.7 squid/src/ftp.c:1.316.2.8 *** squid/src/ftp.c:1.316.2.7 Thu Sep 5 12:08:27 2002 --- squid/src/ftp.c Sat Feb 1 06:30:04 2003 *************** *** 266,271 **** --- 266,278 ---- ftpStateFree(int fdnotused, void *data) { FtpStateData *ftpState = data; + cbdataFree(ftpState); + } + + static void + ftpStateFreed(void *data) + { + FtpStateData *ftpState = data; if (ftpState == NULL) return; debug(9, 3) ("ftpStateFree: %s\n", storeUrl(ftpState->entry)); *************** *** 309,315 **** comm_close(ftpState->data.fd); ftpState->data.fd = -1; } - cbdataFree(ftpState); } static void --- 316,321 ---- *************** *** 1063,1069 **** FtpStateData *ftpState; HttpReply *reply; ! CBDATA_INIT_TYPE(FtpStateData); ftpState = cbdataAlloc(FtpStateData); debug(9, 3) ("ftpStart: '%s'\n", url); statCounter.server.all.requests++; --- 1069,1075 ---- FtpStateData *ftpState; HttpReply *reply; ! CBDATA_INIT_TYPE_FREECB(FtpStateData, ftpStateFreed); ftpState = cbdataAlloc(FtpStateData); debug(9, 3) ("ftpStart: '%s'\n", url); statCounter.server.all.requests++; *************** *** 1718,1723 **** --- 1724,1732 ---- * 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");

AltStyle によって変換されたページ (->オリジナル) /