Added a new callback mechanism and use it for trackers.

This commit is contained in:
Jari Sundell
2026-05-23 16:43:45 +02:00
committed by GitHub
parent 088bf40bdf
commit 8318133c79
4 changed files with 129 additions and 21 deletions
+2 -2
View File
@@ -109,8 +109,8 @@ DownloadFactory::receive_load() {
HttpQueue::iterator itr = m_manager->http_queue()->insert(m_uri, m_stream);
itr->add_done_slot([this]() { receive_loaded(); });
itr->add_failed_slot([this](const std::string& error) { receive_failed(error); });
itr->add_done_slot(torrent::this_thread::thread(), [this]() { receive_loaded(); });
itr->add_failed_slot(torrent::this_thread::thread(), [this](const std::string& error) { receive_failed(error); });
m_variables["tied_to_file"] = (int64_t)false;
+2 -2
View File
@@ -15,8 +15,8 @@ HttpQueue::insert(const std::string& url, std::shared_ptr<std::ostream> stream)
for (auto& slot : m_signal_insert)
slot(*itr);
itr->add_done_slot([this, itr]() { erase(itr); });
itr->add_failed_slot([this, itr](auto) { erase(itr); });
itr->add_done_slot(torrent::this_thread::thread(), [this, itr]() { erase(itr); });
itr->add_failed_slot(torrent::this_thread::thread(), [this, itr](auto) { erase(itr); });
// TODO: Downloading http torrents doesn't seem to work.
// TODO: Quitting no longer works.