Commit 6c1b0fc8 authored by Christian Kandeler's avatar Christian Kandeler
Browse files

SSH: Add infrastructure for passing additional connection options.



So far, the only option is whether to use the default proxy or not. More
will follow.

Change-Id: Icd1ec407a0269cc8e7577901853d3873fd03015c
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 41b96393
......@@ -82,7 +82,7 @@ namespace {
SshConnectionParameters::SshConnectionParameters() :
timeout(0), authenticationType(AuthenticationByKey), port(0), proxyType(NoProxy)
timeout(0), authenticationType(AuthenticationByKey), port(0), options(SshIgnoreDefaultProxy)
{
}
......@@ -226,8 +226,8 @@ SshConnectionPrivate::SshConnectionPrivate(SshConnection *conn,
m_conn(conn)
{
setupPacketHandlers();
m_socket->setProxy(m_connParams.proxyType == SshConnectionParameters::DefaultProxy
? QNetworkProxy::DefaultProxy : QNetworkProxy::NoProxy);
m_socket->setProxy((m_connParams.options & SshIgnoreDefaultProxy)
? QNetworkProxy::NoProxy : QNetworkProxy::DefaultProxy);
m_timeoutTimer.setSingleShot(true);
m_timeoutTimer.setInterval(m_connParams.timeout * 1000);
m_keepAliveTimer.setSingleShot(true);
......
......@@ -36,6 +36,7 @@
#include "ssh_global.h"
#include <QByteArray>
#include <QFlags>
#include <QObject>
#include <QSharedPointer>
#include <QString>
......@@ -50,10 +51,15 @@ namespace Internal {
class SshConnectionPrivate;
} // namespace Internal
enum SshConnectionOption {
SshIgnoreDefaultProxy = 0x1
};
Q_DECLARE_FLAGS(SshConnectionOptions, SshConnectionOption)
class QSSH_EXPORT SshConnectionParameters
{
public:
enum ProxyType { DefaultProxy, NoProxy };
enum AuthenticationType { AuthenticationByPassword, AuthenticationByKey };
SshConnectionParameters();
......@@ -64,7 +70,7 @@ public:
int timeout; // In seconds.
AuthenticationType authenticationType;
quint16 port;
ProxyType proxyType;
SshConnectionOptions options;
};
QSSH_EXPORT bool operator==(const SshConnectionParameters &p1, const SshConnectionParameters &p2);
......
......@@ -1797,7 +1797,7 @@ void DebuggerPluginPrivate::startRemoteEngine()
sp.connParams.timeout = 5;
sp.connParams.authenticationType = QSsh::SshConnectionParameters::AuthenticationByPassword;
sp.connParams.port = 22;
sp.connParams.proxyType = QSsh::SshConnectionParameters::NoProxy;
sp.connParams.options = QSsh::SshIgnoreDefaultProxy;
sp.executable = dlg.inferiorPath();
sp.serverStartScript = dlg.enginePath();
......
......@@ -68,7 +68,7 @@ BlackBerryDeviceConfigurationWizard::BlackBerryDeviceConfigurationWizard(QWidget
ProjectExplorer::IDevice::Ptr BlackBerryDeviceConfigurationWizard::device()
{
QSsh::SshConnectionParameters sshParams;
sshParams.proxyType = QSsh::SshConnectionParameters::NoProxy;
sshParams.options = QSsh::SshIgnoreDefaultProxy;
sshParams.host = m_setupPage->hostName();
sshParams.password = m_setupPage->password();
sshParams.authenticationType = QSsh::SshConnectionParameters::AuthenticationByKey;
......
......@@ -63,7 +63,7 @@ QnxDeviceConfigurationWizard::QnxDeviceConfigurationWizard(QWidget *parent) :
IDevice::Ptr QnxDeviceConfigurationWizard::device()
{
QSsh::SshConnectionParameters sshParams;
sshParams.proxyType = QSsh::SshConnectionParameters::NoProxy;
sshParams.options = QSsh::SshIgnoreDefaultProxy;
sshParams.host = m_setupPage->hostName();
sshParams.userName = m_setupPage->userName();
sshParams.port = 22;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment