#include <clientmedia.h>
|
bool | loadMedia (Client *client, const std::string &data, const std::string &name) override |
|
| IClientMediaDownloader () |
|
virtual | ~IClientMediaDownloader ()=default |
|
virtual bool | loadMedia (Client *client, const std::string &data, const std::string &name)=0 |
|
bool | tryLoadFromCache (const std::string &name, const std::string &sha1, Client *client) |
|
bool | checkAndLoad (const std::string &name, const std::string &sha1, const std::string &data, bool is_from_cache, Client *client) |
|
◆ Stage
Enumerator |
---|
STAGE_INIT | |
STAGE_CACHE_CHECKED | |
STAGE_DONE | |
◆ SingleMediaDownloader()
SingleMediaDownloader::SingleMediaDownloader |
( |
bool |
write_to_cache | ) |
|
◆ ~SingleMediaDownloader()
SingleMediaDownloader::~SingleMediaDownloader |
( |
| ) |
|
◆ addFile()
void SingleMediaDownloader::addFile |
( |
const std::string & |
name, |
|
|
const std::string & |
sha1 |
|
) |
| |
|
overridevirtual |
◆ addRemoteServer()
void SingleMediaDownloader::addRemoteServer |
( |
const std::string & |
baseurl | ) |
|
|
overridevirtual |
◆ conventionalTransferDone()
bool SingleMediaDownloader::conventionalTransferDone |
( |
const std::string & |
name, |
|
|
const std::string & |
data, |
|
|
Client * |
client |
|
) |
| |
|
overridevirtual |
◆ initialStep()
void SingleMediaDownloader::initialStep |
( |
Client * |
client | ) |
|
|
private |
References httpfetch_caller_alloc(), isDone(), m_current_remote, m_file_name, m_file_sha1, m_httpfetch_caller, m_remotes, m_stage, STAGE_DONE, startConventionalTransfer(), startRemoteMediaTransfer(), IClientMediaDownloader::tryLoadFromCache(), and USE_CURL.
Referenced by step().
◆ isDone()
bool SingleMediaDownloader::isDone |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ isStarted()
bool SingleMediaDownloader::isStarted |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ loadMedia()
bool SingleMediaDownloader::loadMedia |
( |
Client * |
client, |
|
|
const std::string & |
data, |
|
|
const std::string & |
name |
|
) |
| |
|
overrideprotectedvirtual |
◆ remoteMediaReceived()
void SingleMediaDownloader::remoteMediaReceived |
( |
const HTTPFetchResult & |
fetch_result, |
|
|
Client * |
client |
|
) |
| |
|
private |
References IClientMediaDownloader::checkAndLoad(), HTTPFetchResult::data, infostream, isDone(), m_current_remote, m_file_name, m_file_sha1, m_remotes, m_stage, sanity_check, STAGE_DONE, startConventionalTransfer(), startRemoteMediaTransfer(), and HTTPFetchResult::succeeded.
Referenced by step().
◆ startConventionalTransfer()
void SingleMediaDownloader::startConventionalTransfer |
( |
Client * |
client | ) |
|
|
private |
◆ startRemoteMediaTransfer()
void SingleMediaDownloader::startRemoteMediaTransfer |
( |
| ) |
|
|
private |
References HTTPFetchRequest::caller, g_settings, Settings::getS32(), hex_encode(), httpfetch_async(), m_current_remote, m_file_name, m_file_sha1, m_httpfetch_caller, m_httpfetch_next_id, m_remotes, HTTPFetchRequest::request_id, HTTPFetchRequest::timeout, HTTPFetchRequest::url, and verbosestream.
Referenced by initialStep(), and remoteMediaReceived().
◆ step()
void SingleMediaDownloader::step |
( |
Client * |
client | ) |
|
|
overridevirtual |
◆ m_current_remote
s32 SingleMediaDownloader::m_current_remote |
|
private |
◆ m_file_name
std::string SingleMediaDownloader::m_file_name |
|
private |
◆ m_file_sha1
std::string SingleMediaDownloader::m_file_sha1 |
|
private |
◆ m_httpfetch_caller
unsigned long SingleMediaDownloader::m_httpfetch_caller |
|
private |
◆ m_httpfetch_next_id
unsigned long SingleMediaDownloader::m_httpfetch_next_id = 0 |
|
private |
◆ m_remotes
std::vector<std::string> SingleMediaDownloader::m_remotes |
|
private |
◆ m_stage
The documentation for this class was generated from the following files: