Use Int64 for TcpServerDispatcher::totalConnections(), to prevent overflow

This commit is contained in:
Étienne Dupuis 2024-08-20 16:51:58 +02:00 committed by Matej Kenda
parent e4aaeacea8
commit 63bed8c8d3
4 changed files with 10 additions and 10 deletions

View File

@ -175,7 +175,7 @@ public:
int maxThreads() const;
/// Returns the maximum number of threads available.
int totalConnections() const;
Int64 totalConnections() const;
/// Returns the total number of handled connections.
int currentConnections() const;

View File

@ -68,7 +68,7 @@ public:
int maxThreads() const;
/// Returns the maximum number of threads available.
int totalConnections() const;
Int64 totalConnections() const;
/// Returns the total number of handled connections.
int currentConnections() const;
@ -103,12 +103,12 @@ private:
std::atomic<int> _rc;
TCPServerParams::Ptr _pParams;
std::atomic<int> _currentThreads;
std::atomic<int> _totalConnections;
std::atomic<int> _currentConnections;
std::atomic<int> _maxConcurrentConnections;
std::atomic<int> _refusedConnections;
std::atomic<bool> _stopped;
std::atomic<int> _currentThreads;
std::atomic<Int64> _totalConnections;
std::atomic<int> _currentConnections;
std::atomic<int> _maxConcurrentConnections;
std::atomic<int> _refusedConnections;
std::atomic<bool> _stopped;
Poco::NotificationQueue _queue;
TCPServerConnectionFactory::Ptr _pConnectionFactory;
Poco::ThreadPool& _threadPool;

View File

@ -185,7 +185,7 @@ int TCPServer::maxThreads() const
}
int TCPServer::totalConnections() const
Int64 TCPServer::totalConnections() const
{
return _pDispatcher->totalConnections();
}

View File

@ -195,7 +195,7 @@ int TCPServerDispatcher::maxThreads() const
}
int TCPServerDispatcher::totalConnections() const
Int64 TCPServerDispatcher::totalConnections() const
{
return _totalConnections;
}