From add953fb6e6ddbe5f034837ff27ba55a2b30e212 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 26 Jan 2017 09:29:49 +0100 Subject: [PATCH] lib/curl/Global: decouple from the IOThread library --- src/lib/curl/Global.cxx | 14 +++++++------- 1 file 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;