Do not let lanlink connections stay open for long without authenticating
If there's no information received, close the socket to try again. Thanks Matthias Gerstner <mgerstner@suse.de> for reporting this.
This commit is contained in:
parent
b496e66899
commit
5310eae85d
1 changed files with 10 additions and 0 deletions
|
@ -374,6 +374,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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue