Commit 34d41975 authored by Albert Vaca Cintora's avatar Albert Vaca Cintora

Merge branch '1.x'

parents be1d43b4 69985f6d
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <QHostInfo> #include <QHostInfo>
#include <QTcpServer> #include <QTcpServer>
#include <QNetworkProxy>
#include <QUdpSocket> #include <QUdpSocket>
#include <QNetworkSession> #include <QNetworkSession>
#include <QNetworkConfigurationManager> #include <QNetworkConfigurationManager>
...@@ -55,8 +56,11 @@ LanLinkProvider::LanLinkProvider(bool testMode) ...@@ -55,8 +56,11 @@ LanLinkProvider::LanLinkProvider(bool testMode)
connect(&mUdpSocket, &QIODevice::readyRead, this, &LanLinkProvider::newUdpConnection); connect(&mUdpSocket, &QIODevice::readyRead, this, &LanLinkProvider::newUdpConnection);
mServer = new Server(this); mServer = new Server(this);
mServer->setProxy(QNetworkProxy::NoProxy);
connect(mServer,&QTcpServer::newConnection,this, &LanLinkProvider::newConnection); connect(mServer,&QTcpServer::newConnection,this, &LanLinkProvider::newConnection);
mUdpSocket.setProxy(QNetworkProxy::NoProxy);
//Detect when a network interface changes status, so we announce ourelves in the new network //Detect when a network interface changes status, so we announce ourelves in the new network
QNetworkConfigurationManager* networkManager = new QNetworkConfigurationManager(this); QNetworkConfigurationManager* networkManager = new QNetworkConfigurationManager(this);
connect(networkManager, &QNetworkConfigurationManager::configurationChanged, this, &LanLinkProvider::onNetworkConfigurationChanged); connect(networkManager, &QNetworkConfigurationManager::configurationChanged, this, &LanLinkProvider::onNetworkConfigurationChanged);
...@@ -135,6 +139,7 @@ void LanLinkProvider::broadcastToNetwork() ...@@ -135,6 +139,7 @@ void LanLinkProvider::broadcastToNetwork()
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
//On Windows we need to broadcast from every local IP address to reach all networks //On Windows we need to broadcast from every local IP address to reach all networks
QUdpSocket sendSocket; QUdpSocket sendSocket;
sendSocket.setProxy(QNetworkProxy::NoProxy);
for (const QNetworkInterface &iface : QNetworkInterface::allInterfaces()) { for (const QNetworkInterface &iface : QNetworkInterface::allInterfaces()) {
if ( (iface.flags() & QNetworkInterface::IsUp) if ( (iface.flags() & QNetworkInterface::IsUp)
&& (iface.flags() & QNetworkInterface::IsRunning) && (iface.flags() & QNetworkInterface::IsRunning)
...@@ -194,6 +199,7 @@ void LanLinkProvider::newUdpConnection() //udpBroadcastReceived ...@@ -194,6 +199,7 @@ void LanLinkProvider::newUdpConnection() //udpBroadcastReceived
//qCDebug(KDECONNECT_CORE) << "Received Udp identity package from" << sender << " asking for a tcp connection on port " << tcpPort; //qCDebug(KDECONNECT_CORE) << "Received Udp identity package from" << sender << " asking for a tcp connection on port " << tcpPort;
QSslSocket* socket = new QSslSocket(this); QSslSocket* socket = new QSslSocket(this);
socket->setProxy(QNetworkProxy::NoProxy);
receivedIdentityPackages[socket].np = receivedPackage; receivedIdentityPackages[socket].np = receivedPackage;
receivedIdentityPackages[socket].sender = sender; receivedIdentityPackages[socket].sender = sender;
connect(socket, &QAbstractSocket::connected, this, &LanLinkProvider::connected); connect(socket, &QAbstractSocket::connected, this, &LanLinkProvider::connected);
...@@ -464,6 +470,8 @@ void LanLinkProvider::configureSslSocket(QSslSocket* socket, const QString& devi ...@@ -464,6 +470,8 @@ void LanLinkProvider::configureSslSocket(QSslSocket* socket, const QString& devi
void LanLinkProvider::configureSocket(QSslSocket* socket) { void LanLinkProvider::configureSocket(QSslSocket* socket) {
socket->setProxy(QNetworkProxy::NoProxy);
socket->setSocketOption(QAbstractSocket::KeepAliveOption, QVariant(1)); socket->setSocketOption(QAbstractSocket::KeepAliveOption, QVariant(1));
#ifdef TCP_KEEPIDLE #ifdef TCP_KEEPIDLE
......
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