From 765834bc2ccbb574217c483d1d3bf23c1ae3d550 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 28 Sep 2018 14:40:48 +0200 Subject: [server] Use MSecs not Secs so we don't require Qt 5.8+ --- src/server/net/sslserver.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/server/net/sslserver.cpp b/src/server/net/sslserver.cpp index 62fe3da..d968834 100644 --- a/src/server/net/sslserver.cpp +++ b/src/server/net/sslserver.cpp @@ -26,7 +26,7 @@ SslServer::SslServer() : QTcpServer(nullptr), _timer(new QTimer(this)) connect(_timer, &QTimer::timeout, [=]() { if (_pending.empty()) return; - const qint64 deadline = QDateTime::currentSecsSinceEpoch() - 10; + const qint64 deadline = QDateTime::currentMSecsSinceEpoch() - 10000; QMutableHashIterator it(_pending); while (it.hasNext()) { // Remove lingering connections after 10s it.next(); @@ -71,7 +71,7 @@ void SslServer::incomingConnection(qintptr socketDescriptor) serverSocket->setPeerVerifyMode(QSslSocket::VerifyNone); serverSocket->setProtocol(QSsl::SecureProtocols); if (serverSocket->setSocketDescriptor(socketDescriptor)) { - _pending.insert(serverSocket, QDateTime::currentSecsSinceEpoch()); + _pending.insert(serverSocket, QDateTime::currentMSecsSinceEpoch()); // Once the connection is successfully encrypted, raise our newConnection event connect(serverSocket, &QSslSocket::encrypted, [=]() { serverSocket->disconnect(this); -- cgit v1.2.3-55-g7522