Commit 4397fe3a authored by Max Kellermann's avatar Max Kellermann

input/curl: fold input_curl_easy_add_indirect() into the only caller

parent 534e1fa6
...@@ -177,23 +177,6 @@ CurlInputStream::DoResume() ...@@ -177,23 +177,6 @@ CurlInputStream::DoResume()
mutex.lock(); mutex.lock();
} }
/**
* Call input_curl_easy_add() in the I/O thread. May be called from
* any thread. Caller must not hold a mutex.
*
* Throws std::runtime_error on error.
*/
static void
input_curl_easy_add_indirect(CurlInputStream *c)
{
assert(c != nullptr);
assert(c->easy);
BlockingCall(io_thread_get(), [c](){
curl_global->Add(c->easy.Get(), *c);
});
}
void void
CurlInputStream::FreeEasy() CurlInputStream::FreeEasy()
{ {
...@@ -546,7 +529,9 @@ CurlInputStream::Open(const char *url, Mutex &mutex, Cond &cond) ...@@ -546,7 +529,9 @@ CurlInputStream::Open(const char *url, Mutex &mutex, Cond &cond)
try { try {
c->InitEasy(); c->InitEasy();
input_curl_easy_add_indirect(c); BlockingCall(io_thread_get(), [c](){
curl_global->Add(c->easy.Get(), *c);
});
} catch (...) { } catch (...) {
delete c; delete c;
throw; throw;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment