Audacity 3.2.0
|
#include <CurlHandleManager.h>
Classes | |
struct | CachedHandle |
class | Handle |
Public Member Functions | |
CurlHandleManager () | |
~CurlHandleManager () | |
void | setProxy (std::string proxy) |
Handle | getHandle (RequestVerb verb, const std::string &url) |
Private Types | |
using | RequestClock = std::chrono::steady_clock |
using | RequestTimePoint = RequestClock::time_point |
Private Member Functions | |
std::string | getUserAgent () const |
CURL * | getCurlHandleFromCache (RequestVerb verb, const std::string &url) |
void | cacheHandle (Handle &handle) |
void | cleanupHandlesCache () |
Static Private Member Functions | |
static std::string | GetSchemeAndDomain (const std::string &url) |
Private Attributes | |
std::string | mProxy |
std::string | mUserAgent |
std::mutex | mHandleCacheLock |
std::vector< CachedHandle > | mHandleCache |
Static Private Attributes | |
static constexpr std::chrono::milliseconds | KEEP_ALIVE_IDLE { std::chrono::seconds (120) } |
static constexpr std::chrono::milliseconds | KEEP_ALIVE_PROBE { std::chrono::seconds (60) } |
Definition at line 31 of file CurlHandleManager.h.
|
private |
Definition at line 99 of file CurlHandleManager.h.
|
private |
Definition at line 100 of file CurlHandleManager.h.
audacity::network_manager::CurlHandleManager::CurlHandleManager | ( | ) |
Definition at line 266 of file CurlHandleManager.cpp.
References audacity::network_manager::anonymous_namespace{CurlHandleManager.cpp}::gCurlConfig, BasicUI::Get(), audacity::network_manager::anonymous_namespace{CurlHandleManager.cpp}::GetOSString(), mProxy, mUserAgent, and audacity::network_manager::anonymous_namespace{CurlHandleManager.cpp}::CurlConfig::Proxy.
audacity::network_manager::CurlHandleManager::~CurlHandleManager | ( | ) |
Definition at line 285 of file CurlHandleManager.cpp.
References mHandleCache, and mHandleCacheLock.
|
private |
Definition at line 349 of file CurlHandleManager.cpp.
References cleanupHandlesCache(), GetSchemeAndDomain(), audacity::network_manager::CurlHandleManager::Handle::mHandle, mHandleCache, mHandleCacheLock, audacity::network_manager::CurlHandleManager::Handle::mUrl, audacity::network_manager::CurlHandleManager::Handle::mVerb, and audacity::network_manager::CurlHandleManager::Handle::reset().
Referenced by audacity::network_manager::CurlHandleManager::Handle::~Handle().
|
private |
Definition at line 366 of file CurlHandleManager.cpp.
References mHandleCache.
Referenced by cacheHandle(), and getCurlHandleFromCache().
|
private |
Definition at line 327 of file CurlHandleManager.cpp.
References cleanupHandlesCache(), GetSchemeAndDomain(), audacity::network_manager::CurlHandleManager::CachedHandle::Handle, mHandleCache, and mHandleCacheLock.
Referenced by getHandle().
CurlHandleManager::Handle audacity::network_manager::CurlHandleManager::getHandle | ( | RequestVerb | verb, |
const std::string & | url | ||
) |
Definition at line 298 of file CurlHandleManager.cpp.
References getCurlHandleFromCache(), KEEP_ALIVE_IDLE, KEEP_ALIVE_PROBE, mProxy, and audacity::network_manager::CurlHandleManager::Handle::setOption().
Referenced by audacity::network_manager::CurlResponse::perform().
|
staticprivate |
Definition at line 375 of file CurlHandleManager.cpp.
References Tuple::detail::npos().
Referenced by cacheHandle(), and getCurlHandleFromCache().
|
private |
Definition at line 322 of file CurlHandleManager.cpp.
References mUserAgent.
void audacity::network_manager::CurlHandleManager::setProxy | ( | std::string | proxy | ) |
Definition at line 293 of file CurlHandleManager.cpp.
References mProxy.
|
staticconstexprprivate |
Definition at line 102 of file CurlHandleManager.h.
Referenced by getHandle().
|
staticconstexprprivate |
Definition at line 103 of file CurlHandleManager.h.
Referenced by getHandle().
|
private |
Definition at line 128 of file CurlHandleManager.h.
Referenced by cacheHandle(), cleanupHandlesCache(), getCurlHandleFromCache(), and ~CurlHandleManager().
|
private |
Definition at line 127 of file CurlHandleManager.h.
Referenced by cacheHandle(), getCurlHandleFromCache(), and ~CurlHandleManager().
|
private |
Definition at line 124 of file CurlHandleManager.h.
Referenced by CurlHandleManager(), getHandle(), and setProxy().
|
private |
Definition at line 125 of file CurlHandleManager.h.
Referenced by CurlHandleManager(), and getUserAgent().