MCPcopy Create free account
hub / github.com/arvidn/libtorrent / remove_request

Method remove_request

src/tracker_manager.cpp:226–252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 2

closeMethod · 0.80
closeMethod · 0.80

Calls 12

frontMethod · 0.80
push_backMethod · 0.80
set_valueMethod · 0.80
is_single_threadFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
getMethod · 0.45
eraseMethod · 0.45
emptyMethod · 0.45
pop_frontMethod · 0.45
startMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected