forked from qt-creator/qt-creator
SSH: Don't allow connectToHost() while already connecting/connected.
Also fix callers potentially violating this policy. Change-Id: I630f1c544885df93a81e217e792363c0c2314108 Reviewed-on: http://codereview.qt.nokia.com/1186 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
@@ -620,6 +620,8 @@ void SshConnectionPrivate::sendKeepAlivePacket()
|
|||||||
|
|
||||||
void SshConnectionPrivate::connectToHost()
|
void SshConnectionPrivate::connectToHost()
|
||||||
{
|
{
|
||||||
|
QTC_ASSERT(m_state == SocketUnconnected, return);
|
||||||
|
|
||||||
m_incomingData.clear();
|
m_incomingData.clear();
|
||||||
m_incomingPacket.reset();
|
m_incomingPacket.reset();
|
||||||
m_sendFacility.reset();
|
m_sendFacility.reset();
|
||||||
|
|||||||
@@ -145,7 +145,8 @@ void SshRemoteProcessRunnerPrivate::run(const QByteArray &command)
|
|||||||
} else {
|
} else {
|
||||||
connect(m_connection.data(), SIGNAL(connected()),
|
connect(m_connection.data(), SIGNAL(connected()),
|
||||||
SLOT(handleConnected()));
|
SLOT(handleConnected()));
|
||||||
m_connection->connectToHost();
|
if (m_connection->state() == SshConnection::Unconnected)
|
||||||
|
m_connection->connectToHost();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -98,7 +98,8 @@ void RemoteGdbProcess::realStart(const QString &cmd, const QStringList &args,
|
|||||||
handleConnected();
|
handleConnected();
|
||||||
} else {
|
} else {
|
||||||
connect(m_conn.data(), SIGNAL(connected()), this, SLOT(handleConnected()));
|
connect(m_conn.data(), SIGNAL(connected()), this, SLOT(handleConnected()));
|
||||||
m_conn->connectToHost();
|
if (m_conn->state() == SshConnection::Unconnected)
|
||||||
|
m_conn->connectToHost();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -298,7 +298,8 @@ void AbstractMaemoDeployStep::connectToDevice()
|
|||||||
connect(m_connection.data(), SIGNAL(connected()), this,
|
connect(m_connection.data(), SIGNAL(connected()), this,
|
||||||
SLOT(handleConnected()));
|
SLOT(handleConnected()));
|
||||||
writeOutput(tr("Connecting to device..."));
|
writeOutput(tr("Connecting to device..."));
|
||||||
m_connection->connectToHost();
|
if (m_connection->state() == SshConnection::Unconnected)
|
||||||
|
m_connection->connectToHost();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -105,7 +105,8 @@ void RemoteLinuxApplicationRunner::start()
|
|||||||
handleConnected();
|
handleConnected();
|
||||||
} else {
|
} else {
|
||||||
emit reportProgress(tr("Connecting to device..."));
|
emit reportProgress(tr("Connecting to device..."));
|
||||||
m_connection->connectToHost();
|
if (m_connection->state() == Utils::SshConnection::Unconnected)
|
||||||
|
m_connection->connectToHost();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -186,7 +186,8 @@ void RemoteValgrindProcess::run(const QString &valgrindExecutable, const QString
|
|||||||
this, SLOT(connected()));
|
this, SLOT(connected()));
|
||||||
connect(m_connection.data(), SIGNAL(error(Utils::SshError)),
|
connect(m_connection.data(), SIGNAL(error(Utils::SshError)),
|
||||||
this, SLOT(error(Utils::SshError)));
|
this, SLOT(error(Utils::SshError)));
|
||||||
m_connection->connectToHost();
|
if (m_connection->state() == Utils::SshConnection::Unconnected)
|
||||||
|
m_connection->connectToHost();
|
||||||
} else {
|
} else {
|
||||||
connected();
|
connected();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user