mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-17 22:18:05 -06:00
Make use of chrono literals from std library
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
#include "server.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <chrono>
|
||||
|
||||
#include <QNetworkProxy>
|
||||
#include <QSslCipher>
|
||||
@@ -44,11 +45,13 @@
|
||||
#include "base/utils/net.h"
|
||||
#include "connection.h"
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
namespace
|
||||
{
|
||||
const int KEEP_ALIVE_DURATION = 7 * 1000; // milliseconds
|
||||
const int KEEP_ALIVE_DURATION = std::chrono::milliseconds(7s).count();
|
||||
const int CONNECTIONS_LIMIT = 500;
|
||||
const int CONNECTIONS_SCAN_INTERVAL = 2; // seconds
|
||||
const std::chrono::seconds CONNECTIONS_SCAN_INTERVAL {2};
|
||||
|
||||
QList<QSslCipher> safeCipherList()
|
||||
{
|
||||
@@ -81,7 +84,7 @@ Server::Server(IRequestHandler *requestHandler, QObject *parent)
|
||||
|
||||
auto *dropConnectionTimer = new QTimer(this);
|
||||
connect(dropConnectionTimer, &QTimer::timeout, this, &Server::dropTimedOutConnection);
|
||||
dropConnectionTimer->start(CONNECTIONS_SCAN_INTERVAL * 1000);
|
||||
dropConnectionTimer->start(CONNECTIONS_SCAN_INTERVAL);
|
||||
}
|
||||
|
||||
void Server::incomingConnection(const qintptr socketDescriptor)
|
||||
|
||||
Reference in New Issue
Block a user