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 27
27
#include < cstdlib>
28
28
#include < deque>
29
29
#include < memory>
30
- #include < numeric>
31
30
#include < optional>
32
31
#include < string>
33
32
#include < unordered_map>
@@ -193,13 +192,6 @@ class HTTPRequestTracker
193
192
auto it{m_tracker.find (Assert (conn))};
194
193
if (it != m_tracker.end ()) RemoveConnectionInternal (it);
195
194
}
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
- }
203
195
size_t CountActiveConnections () const EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
204
196
{
205
197
return WITH_LOCK (m_mutex, return m_tracker.size ());
@@ -530,8 +522,8 @@ void StopHTTPServer()
530
522
}
531
523
boundSockets.clear ();
532
524
{
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 );
535
527
}
536
528
g_requests.WaitUntilEmpty ();
537
529
}
You can’t perform that action at this time.
0 commit comments