Go to the source code of this file.
Classes | |
struct | HTTPFetchRequest |
struct | HTTPFetchResult |
Macros | |
#define | HTTPFETCH_DISCARD 0 |
#define | HTTPFETCH_SYNC 1 |
#define | HTTPFETCH_PRINT_ERR 2 |
#define | HTTPFETCH_CID_START 3 |
Enumerations | |
enum | HttpMethod : u8 { HTTP_GET , HTTP_POST , HTTP_PUT , HTTP_DELETE } |
Functions | |
void | httpfetch_init (int parallel_limit) |
void | httpfetch_cleanup () |
void | httpfetch_async (const HTTPFetchRequest &fetch_request) |
bool | httpfetch_async_get (u64 caller, HTTPFetchResult &fetch_result) |
u64 | httpfetch_caller_alloc () |
u64 | httpfetch_caller_alloc_secure () |
void | httpfetch_caller_free (u64 caller) |
bool | httpfetch_sync_interruptible (const HTTPFetchRequest &fetch_request, HTTPFetchResult &fetch_result, long interval=100) |
#define HTTPFETCH_CID_START 3 |
Referenced by httpfetch_caller_alloc(), and httpfetch_caller_alloc_secure().
#define HTTPFETCH_DISCARD 0 |
#define HTTPFETCH_PRINT_ERR 2 |
Referenced by HTTPFetchOngoing::complete(), and ServerList::sendAnnounce().
#define HTTPFETCH_SYNC 1 |
Referenced by GUIEngine::downloadFile().
enum HttpMethod : u8 |
void httpfetch_async | ( | const HTTPFetchRequest & | fetch_request | ) |
References g_httpfetch_thread.
Referenced by httpfetch_sync_interruptible(), ClientMediaDownloader::initialStep(), ModApiHttp::l_http_fetch_async(), ServerList::sendAnnounce(), SingleMediaDownloader::startRemoteMediaTransfer(), and ClientMediaDownloader::startRemoteMediaTransfers().
bool httpfetch_async_get | ( | u64 | caller, |
HTTPFetchResult & | fetch_result ) |
References g_httpfetch_mutex, and g_httpfetch_results.
Referenced by httpfetch_sync_interruptible(), ModApiHttp::l_http_fetch_async_get(), ClientMediaDownloader::step(), and SingleMediaDownloader::step().
u64 httpfetch_caller_alloc | ( | ) |
References FATAL_ERROR, g_httpfetch_mutex, g_httpfetch_results, HTTPFETCH_CID_START, and verbosestream.
Referenced by ClientMediaDownloader::initialStep(), and SingleMediaDownloader::initialStep().
u64 httpfetch_caller_alloc_secure | ( | ) |
References FATAL_ERROR, g_callerid_randomness, g_httpfetch_mutex, g_httpfetch_results, HTTPFETCH_CID_START, HTTPFETCH_DISCARD, PcgRandom::next(), and verbosestream.
Referenced by httpfetch_sync_interruptible(), and ModApiHttp::read_http_fetch_request().
void httpfetch_caller_free | ( | u64 | caller | ) |
References g_httpfetch_mutex, g_httpfetch_results, HTTPFETCH_DISCARD, httpfetch_request_clear(), and verbosestream.
Referenced by ClientMediaDownloader::~ClientMediaDownloader(), SingleMediaDownloader::~SingleMediaDownloader(), and httpfetch_sync_interruptible().
void httpfetch_cleanup | ( | ) |
References g_httpfetch_thread, and verbosestream.
Referenced by uninit_common().
void httpfetch_init | ( | int | parallel_limit | ) |
References FATAL_ERROR_IF, g_callerid_randomness, g_httpfetch_thread, porting::secure_rand_fill_buf(), and verbosestream.
Referenced by init_common().
bool httpfetch_sync_interruptible | ( | const HTTPFetchRequest & | fetch_request, |
HTTPFetchResult & | fetch_result, | ||
long | interval = 100 ) |
References HTTPFetchRequest::caller, Thread::getCurrentThread(), httpfetch_async(), httpfetch_async_get(), httpfetch_caller_alloc_secure(), httpfetch_caller_free(), sleep_ms, and HTTPFetchRequest::url.
Referenced by GUIEngine::downloadFile(), and ModApiHttp::l_http_fetch_sync().