| 224 | } |
| 225 | |
| 226 | void tracker_manager::remove_request(http_tracker_connection const* c) |
| 227 | { |
| 228 | TORRENT_ASSERT(is_single_thread()); |
| 229 | auto const i = std::find_if(m_http_conns.begin(), m_http_conns.end() |
| 230 | , [c] (std::shared_ptr<http_tracker_connection> const& ptr) { return ptr.get() == c; }); |
| 231 | if (i != m_http_conns.end()) |
| 232 | { |
| 233 | m_http_conns.erase(i); |
| 234 | if (!m_queued.empty()) |
| 235 | { |
| 236 | auto conn = std::move(m_queued.front()); |
| 237 | m_queued.pop_front(); |
| 238 | m_http_conns.push_back(std::move(conn)); |
| 239 | m_http_conns.back()->start(); |
| 240 | m_stats_counters.set_value(counters::num_queued_tracker_announces, std::int64_t(m_queued.size())); |
| 241 | } |
| 242 | return; |
| 243 | } |
| 244 | |
| 245 | auto const j = std::find_if(m_queued.begin(), m_queued.end() |
| 246 | , [c] (std::shared_ptr<http_tracker_connection> const& ptr) { return ptr.get() == c; }); |
| 247 | if (j != m_queued.end()) |
| 248 | { |
| 249 | m_queued.erase(j); |
| 250 | m_stats_counters.set_value(counters::num_queued_tracker_announces, std::int64_t(m_queued.size())); |
| 251 | } |
| 252 | } |
| 253 | |
| 254 | void tracker_manager::remove_request(udp_tracker_connection const* c) |
| 255 | { |