Converted curl/http to be thread-safe.

This commit is contained in:
Jari Sundell
2025-06-11 17:04:40 +02:00
committed by GitHub
parent a51f367671
commit 41589f06c2
3 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -8,13 +8,13 @@
namespace core {
HttpQueue::iterator
HttpQueue::insert(const std::string& url, std::iostream* s) {
auto itr = base_type::insert(end(), torrent::net_thread::http_stack()->create(url, s));
HttpQueue::insert(const std::string& url, std::iostream* stream) {
auto itr = base_type::insert(end(), torrent::net::HttpGet(url, stream));
itr->add_done_slot([this, itr]() { erase(itr); });
itr->add_failed_slot([this, itr](auto) { erase(itr); });
itr->start();
torrent::net_thread::http_stack()->start_get(*itr);
for (auto& slot : m_signal_insert)
slot(*itr);