File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change 2727#include < cstdlib>
2828#include < deque>
2929#include < memory>
30- #include < numeric>
3130#include < optional>
3231#include < string>
3332#include < unordered_map>
@@ -193,13 +192,6 @@ class HTTPRequestTracker
193192 auto it{m_tracker.find (Assert (conn))};
194193 if (it != m_tracker.end ()) RemoveConnectionInternal (it);
195194 }
196-
197- size_t CountActiveRequests () const EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
198- {
199- LOCK (m_mutex);
200- return std::accumulate (m_tracker.begin (), m_tracker.end (), size_t (0 ),
201- [](size_t acc_count, const auto & pair) { return acc_count + pair.second ; });
202- }
203195 size_t CountActiveConnections () const EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
204196 {
205197 return WITH_LOCK (m_mutex, return m_tracker.size ());
@@ -530,8 +522,8 @@ void StopHTTPServer()
530522 }
531523 boundSockets.clear ();
532524 {
533- if (g_requests.CountActiveConnections () != 0 ) {
534- LogPrint (BCLog::HTTP, " Waiting for %d requests to stop HTTP server\n " , g_requests. CountActiveRequests () );
525+ if (const auto n_connections{ g_requests.CountActiveConnections ()}; n_connections != 0 ) {
526+ LogPrint (BCLog::HTTP, " Waiting for %d connections to stop HTTP server\n " , n_connections );
535527 }
536528 g_requests.WaitUntilEmpty ();
537529 }
You can’t perform that action at this time.
0 commit comments