From: hno <> Date: Tue, 4 Mar 2003 05:14:13 +0000 (+0000) Subject: Get rid of that ugly depencendy on COMM_ERR_CLOSING for freeing X-Git-Tag: SQUID_3_0_PRE1~289 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6800b5b543926a352029d73cdcb30c884ecb4388;p=thirdparty%2Fsquid.git Get rid of that ugly depencendy on COMM_ERR_CLOSING for freeing the FTP control channel buffer on aborts while sending commands.. the data was even kept in the ftpState already, making the extra buffer totally unneeded. --- diff --git a/src/ftp.cc b/src/ftp.cc index 397f998537..ef0f8d4628 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -1,6 +1,6 @@ /* - * $Id: ftp.cc,v 1.344 2003/03/02 23:13:49 hno Exp $ + * $Id: ftp.cc,v 1.345 2003/03/03 22:14:13 hno Exp $ * * DEBUG: section 9 File Transfer Protocol (FTP) * AUTHOR: Harvest Derived @@ -1408,8 +1408,8 @@ ftpWriteCommand(const char *buf, FtpStateData * ftpState) safe_free(ftpState->ctrl.last_reply); ftpState->ctrl.last_command = xstrdup(buf); comm_write(ftpState->ctrl.fd, - xstrdup(buf), - strlen(buf), + ftpState->ctrl.last_command, + strlen(ftpState->ctrl.last_command), ftpWriteCommandCallback, ftpState); ftpScheduleReadControlReply(ftpState, 0); @@ -1419,7 +1419,7 @@ static void ftpWriteCommandCallback(int fd, char *buf, size_t size, comm_err_t errflag, int xerrno, void *data) { FtpStateData *ftpState = (FtpStateData *)data; - xfree(buf); + debug(9, 7) ("ftpWriteCommandCallback: wrote %d bytes\n", (int) size); if (size > 0) {