diff --git a/core/backends/lan/lanlinkprovider.cpp b/core/backends/lan/lanlinkprovider.cpp index aeabc7f30..542f658e2 100644 --- a/core/backends/lan/lanlinkprovider.cpp +++ b/core/backends/lan/lanlinkprovider.cpp @@ -392,6 +392,16 @@ void LanLinkProvider::newConnection() connect(socket, &QIODevice::readyRead, this, &LanLinkProvider::dataReceived); + QTimer* timer = new QTimer(socket); + timer->setSingleShot(true); + timer->setInterval(1000); + connect(socket, &QSslSocket::encrypted, + timer, &QObject::deleteLater); + connect(timer, &QTimer::timeout, socket, [socket] { + qCWarning(KDECONNECT_CORE) << "LanLinkProvider/newConnection: Host timed out without sending any identity." << socket->peerAddress(); + socket->disconnectFromHost(); + }); + timer->start(); } }