diff options
Diffstat (limited to 'src/network/access/qftp.cpp')
-rw-r--r-- | src/network/access/qftp.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/network/access/qftp.cpp b/src/network/access/qftp.cpp index 569d2fd..c54c420 100644 --- a/src/network/access/qftp.cpp +++ b/src/network/access/qftp.cpp @@ -314,8 +314,10 @@ void QFtpDTP::connectToHost(const QString & host, quint16 port) { bytesFromSocket.clear(); - if (socket) + if (socket) { delete socket; + socket = 0; + } socket = new QTcpSocket(this); socket->setObjectName(QLatin1String("QFtpDTP Passive state socket")); connect(socket, SIGNAL(connected()), SLOT(socketConnected())); @@ -1658,11 +1660,12 @@ QFtp::QFtp(QObject *parent, const char *name) */ int QFtp::connectToHost(const QString &host, quint16 port) { - d_func()->pi.transferConnectionExtended = true; QStringList cmds; cmds << host; cmds << QString::number((uint)port); - return d_func()->addCommand(new QFtpCommand(ConnectToHost, cmds)); + int id = d_func()->addCommand(new QFtpCommand(ConnectToHost, cmds)); + d_func()->pi.transferConnectionExtended = true; + return id; } /*! @@ -1721,9 +1724,10 @@ int QFtp::close() */ int QFtp::setTransferMode(TransferMode mode) { + int id = d_func()->addCommand(new QFtpCommand(SetTransferMode, QStringList())); d_func()->pi.transferConnectionExtended = true; d_func()->transferMode = mode; - return d_func()->addCommand(new QFtpCommand(SetTransferMode, QStringList())); + return id; } /*! |