diff options
author | Max Kellermann <max@musicpd.org> | 2017-01-26 09:29:49 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2017-01-26 09:29:49 +0100 |
commit | add953fb6e6ddbe5f034837ff27ba55a2b30e212 (patch) | |
tree | 274e5c53cf628267592e2a4ca6e641f8aca91bf1 /src/lib/curl | |
parent | 3854211694c5e2c71a2e3ff2a0f141814169d5dc (diff) |
lib/curl/Global: decouple from the IOThread library
Diffstat (limited to 'src/lib/curl')
-rw-r--r-- | src/lib/curl/Global.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/curl/Global.cxx b/src/lib/curl/Global.cxx index 12a8f638a..922089bb0 100644 --- a/src/lib/curl/Global.cxx +++ b/src/lib/curl/Global.cxx @@ -30,8 +30,8 @@ #include "config.h" #include "Global.hxx" #include "Request.hxx" -#include "IOThread.hxx" #include "Log.hxx" +#include "event/Loop.hxx" #include "event/SocketMonitor.hxx" #include "util/RuntimeError.hxx" #include "util/Domain.hxx" @@ -112,7 +112,7 @@ CurlSocket::SocketFunction(gcc_unused CURL *easy, auto &global = *(CurlGlobal *)userp; CurlSocket *cs = (CurlSocket *)socketp; - assert(io_thread_inside()); + assert(global.GetEventLoop().IsInside()); if (action == CURL_POLL_REMOVE) { delete cs; @@ -120,7 +120,7 @@ CurlSocket::SocketFunction(gcc_unused CURL *easy, } if (cs == nullptr) { - cs = new CurlSocket(global, io_thread_get(), s); + cs = new CurlSocket(global, global.GetEventLoop(), s); global.Assign(s, *cs); } else { #ifdef USE_EPOLL @@ -145,7 +145,7 @@ CurlSocket::SocketFunction(gcc_unused CURL *easy, bool CurlSocket::OnSocketReady(unsigned flags) { - assert(io_thread_inside()); + assert(GetEventLoop().IsInside()); global.SocketAction(Get(), FlagsToCurlCSelect(flags)); return true; @@ -159,7 +159,7 @@ CurlSocket::OnSocketReady(unsigned flags) void CurlGlobal::Add(CURL *easy, CurlRequest &request) { - assert(io_thread_inside()); + assert(GetEventLoop().IsInside()); assert(easy != nullptr); curl_easy_setopt(easy, CURLOPT_PRIVATE, &request); @@ -175,7 +175,7 @@ CurlGlobal::Add(CURL *easy, CurlRequest &request) void CurlGlobal::Remove(CURL *easy) { - assert(io_thread_inside()); + assert(GetEventLoop().IsInside()); assert(easy != nullptr); curl_multi_remove_handle(multi.Get(), easy); @@ -202,7 +202,7 @@ ToRequest(CURL *easy) inline void CurlGlobal::ReadInfo() { - assert(io_thread_inside()); + assert(GetEventLoop().IsInside()); CURLMsg *msg; int msgs_in_queue; |