13#include <unordered_map>
18#define MTHASHSET_FILE_SIGNATURE 0x4d544853
19#define MTHASHSET_FILE_NAME "index.mth"
25 const std::string &filedata);
29 const std::string &path);
43 virtual
void addFile(const std::
string &name, const std::
string &sha1) = 0;
71 const std::
string &name) = 0;
76 bool checkAndLoad(const std::
string &name, const std::
string &sha1,
77 const std::
string &data,
bool is_from_cache,
Client *
client);
91 if (m_uncached_count >= 1)
92 return 1.0f * m_uncached_received_count /
99 return m_initial_step_done;
103 return m_initial_step_done &&
104 m_uncached_received_count == m_uncached_count;
107 void addFile(
const std::string &name,
const std::string &sha1)
override;
114 const std::string &name,
115 const std::string &data,
120 const std::string &name)
override;
139 s32 selectRemoteServer(
FileStatus *filestatus);
140 void startRemoteMediaTransfers();
143 static void deSerializeHashSet(
const std::string &data,
144 std::set<std::string> &result);
145 std::string serializeRequiredHashSet();
155 bool m_initial_step_done =
false;
158 s32 m_uncached_count = 0;
161 s32 m_uncached_received_count = 0;
165 u64 m_httpfetch_next_id = 0;
166 s32 m_httpfetch_active = 0;
167 s32 m_httpfetch_active_limit = 0;
168 s32 m_outstanding_hash_sets = 0;
175 std::string m_name_bound =
"";
191 return m_stage > STAGE_INIT;
195 return m_stage >= STAGE_DONE;
198 void addFile(
const std::string &name,
const std::string &sha1)
override;
200 void addRemoteServer(
const std::string &baseurl)
override;
204 bool conventionalTransferDone(
const std::string &name,
209 const std::string &name)
override;
214 void startRemoteMediaTransfer();
235 unsigned long m_httpfetch_next_id = 0;
#define DISABLE_CLASS_COPY(C)
Definition basic_macros.h:26
Definition filecache.h:13
Definition activeobjectmgr.cpp:11
Definition httpfetch.h:81