#include <clientmedia.h>
◆ ClientMediaDownloader()
ClientMediaDownloader::ClientMediaDownloader |
( |
| ) |
|
◆ ~ClientMediaDownloader()
ClientMediaDownloader::~ClientMediaDownloader |
( |
| ) |
|
◆ addFile()
void ClientMediaDownloader::addFile |
( |
const std::string & | name, |
|
|
const std::string & | sha1 ) |
|
overridevirtual |
◆ addRemoteServer()
void ClientMediaDownloader::addRemoteServer |
( |
const std::string & | baseurl | ) |
|
|
overridevirtual |
◆ conventionalTransferDone()
bool ClientMediaDownloader::conventionalTransferDone |
( |
const std::string & | name, |
|
|
const std::string & | data, |
|
|
Client * | client ) |
|
overridevirtual |
◆ deSerializeHashSet()
void ClientMediaDownloader::deSerializeHashSet |
( |
const std::string & | data, |
|
|
std::set< std::string > & | result ) |
|
staticprivate |
◆ getProgress()
float ClientMediaDownloader::getProgress |
( |
| ) |
const |
|
inline |
◆ initialStep()
void ClientMediaDownloader::initialStep |
( |
Client * | client | ) |
|
|
private |
References actionstream, ClientMediaDownloader::RemoteServerStatus::baseurl, HTTPFetchRequest::caller, HTTPFetchRequest::extra_headers, g_settings, porting::getDeltaMs(), Settings::getS32(), porting::getTimeMs(), HTTP_POST, httpfetch_async(), httpfetch_caller_alloc(), m_files, m_httpfetch_active, m_httpfetch_active_limit, m_httpfetch_caller, m_httpfetch_next_id, m_outstanding_hash_sets, m_remotes, m_uncached_count, m_uncached_received_count, HTTPFetchRequest::method, MTHASHSET_FILE_NAME, MYMAX, HTTPFetchRequest::raw_data, ClientMediaDownloader::FileStatus::received, HTTPFetchRequest::request_id, serializeRequiredHashSet(), ClientMediaDownloader::FileStatus::sha1, startConventionalTransfers(), IClientMediaDownloader::tryLoadFromCache(), HTTPFetchRequest::url, and wstrgettext().
Referenced by step().
◆ isDone()
bool ClientMediaDownloader::isDone |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ isStarted()
bool ClientMediaDownloader::isStarted |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ loadMedia()
bool ClientMediaDownloader::loadMedia |
( |
Client * | client, |
|
|
const std::string & | data, |
|
|
const std::string & | name ) |
|
overrideprotectedvirtual |
◆ remoteHashSetReceived()
void ClientMediaDownloader::remoteHashSetReceived |
( |
const HTTPFetchResult & | fetch_result | ) |
|
|
private |
References ClientMediaDownloader::FileStatus::available_remotes, ClientMediaDownloader::RemoteServerStatus::baseurl, HTTPFetchResult::data, deSerializeHashSet(), infostream, m_files, m_name_bound, m_outstanding_hash_sets, m_remotes, ClientMediaDownloader::FileStatus::received, HTTPFetchResult::request_id, ClientMediaDownloader::FileStatus::sha1, HTTPFetchResult::succeeded, and BaseException::what().
Referenced by step().
◆ remoteMediaReceived()
void ClientMediaDownloader::remoteMediaReceived |
( |
const HTTPFetchResult & | fetch_result, |
|
|
Client * | client ) |
|
private |
References ClientMediaDownloader::RemoteServerStatus::active_count, IClientMediaDownloader::checkAndLoad(), ClientMediaDownloader::FileStatus::current_remote, HTTPFetchResult::data, m_files, m_remote_file_transfers, m_remotes, m_uncached_count, m_uncached_received_count, ClientMediaDownloader::FileStatus::received, HTTPFetchResult::request_id, sanity_check, ClientMediaDownloader::FileStatus::sha1, and HTTPFetchResult::succeeded.
Referenced by step().
◆ selectRemoteServer()
s32 ClientMediaDownloader::selectRemoteServer |
( |
FileStatus * | filestatus | ) |
|
|
private |
◆ serializeRequiredHashSet()
std::string ClientMediaDownloader::serializeRequiredHashSet |
( |
| ) |
|
|
private |
◆ startConventionalTransfers()
void ClientMediaDownloader::startConventionalTransfers |
( |
Client * | client | ) |
|
|
private |
◆ startRemoteMediaTransfers()
void ClientMediaDownloader::startRemoteMediaTransfers |
( |
| ) |
|
|
private |
References ClientMediaDownloader::RemoteServerStatus::active_count, ClientMediaDownloader::RemoteServerStatus::baseurl, HTTPFetchRequest::caller, ClientMediaDownloader::FileStatus::current_remote, g_settings, Settings::getS32(), hex_encode(), httpfetch_async(), m_files, m_httpfetch_active, m_httpfetch_active_limit, m_httpfetch_caller, m_httpfetch_next_id, m_name_bound, m_outstanding_hash_sets, m_remote_file_transfers, m_remotes, ClientMediaDownloader::FileStatus::received, HTTPFetchRequest::request_id, selectRemoteServer(), ClientMediaDownloader::FileStatus::sha1, HTTPFetchRequest::timeout, HTTPFetchRequest::url, and verbosestream.
Referenced by step().
◆ step()
void ClientMediaDownloader::step |
( |
Client * | client | ) |
|
|
overridevirtual |
Implements IClientMediaDownloader.
References httpfetch_async_get(), infostream, initialStep(), m_httpfetch_active, m_httpfetch_caller, m_initial_step_done, m_remotes, m_uncached_count, m_uncached_received_count, remoteHashSetReceived(), remoteMediaReceived(), HTTPFetchResult::request_id, startConventionalTransfers(), and startRemoteMediaTransfers().
Referenced by Client::handleCommand_AnnounceMedia(), and Client::step().
◆ m_files
std::map<std::string, FileStatus*> ClientMediaDownloader::m_files |
|
private |
◆ m_httpfetch_active
s32 ClientMediaDownloader::m_httpfetch_active = 0 |
|
private |
◆ m_httpfetch_active_limit
s32 ClientMediaDownloader::m_httpfetch_active_limit = 0 |
|
private |
◆ m_httpfetch_caller
u64 ClientMediaDownloader::m_httpfetch_caller |
|
private |
◆ m_httpfetch_next_id
u64 ClientMediaDownloader::m_httpfetch_next_id = 0 |
|
private |
◆ m_initial_step_done
bool ClientMediaDownloader::m_initial_step_done = false |
|
private |
◆ m_name_bound
std::string ClientMediaDownloader::m_name_bound = "" |
|
private |
◆ m_outstanding_hash_sets
s32 ClientMediaDownloader::m_outstanding_hash_sets = 0 |
|
private |
◆ m_remote_file_transfers
std::unordered_map<u64, std::string> ClientMediaDownloader::m_remote_file_transfers |
|
private |
◆ m_remotes
◆ m_uncached_count
s32 ClientMediaDownloader::m_uncached_count = 0 |
|
private |
◆ m_uncached_received_count
s32 ClientMediaDownloader::m_uncached_received_count = 0 |
|
private |
The documentation for this class was generated from the following files: