summaryrefslogtreecommitdiffstats
path: root/src/network/access/qftp.cpp
diff options
context:
space:
mode:
authorRobert Griebl <rgriebl@trolltech.com>2009-06-10 11:46:23 (GMT)
committerRobert Griebl <rgriebl@trolltech.com>2009-06-10 11:46:23 (GMT)
commit7604f8087f88171ef933d8ae08f501467e647338 (patch)
tree51d071f462ed48d0b25884d9f62b8ba11c5dff13 /src/network/access/qftp.cpp
parent8c265860b41214daade7c8a28237c1e07ea71a3c (diff)
downloadQt-7604f8087f88171ef933d8ae08f501467e647338.zip
Qt-7604f8087f88171ef933d8ae08f501467e647338.tar.gz
Qt-7604f8087f88171ef933d8ae08f501467e647338.tar.bz2
Make Qt exception safer.
Squashed commit of the branch haralds-haralds-qt-s60-topics/topic/exceptions, which also contains the full history. Rev-By: Harald Fernengel Rev-By: Ralf Engels
Diffstat (limited to 'src/network/access/qftp.cpp')
-rw-r--r--src/network/access/qftp.cpp12
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;
}
/*!