From 6ccb5835ff55d85156be91473c598eca9d6cb9a6 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Wed, 4 Nov 2020 16:57:41 +0100 Subject: Revert "Make Lint Happy" This reverts commit ad148587dcf5244c2d2011dba339786c765c54c4. --- src/client/clientmedia.h | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) (limited to 'src/client/clientmedia.h') diff --git a/src/client/clientmedia.h b/src/client/clientmedia.h index 6a52c551d..5a918535b 100644 --- a/src/client/clientmedia.h +++ b/src/client/clientmedia.h @@ -35,7 +35,8 @@ struct HTTPFetchResult; // Store file into media cache (unless it exists already) // Validating the hash is responsibility of the caller -bool clientMediaUpdateCache(const std::string &raw_hash, const std::string &filedata); +bool clientMediaUpdateCache(const std::string &raw_hash, + const std::string &filedata); class ClientMediaDownloader { @@ -43,21 +44,22 @@ public: ClientMediaDownloader(); ~ClientMediaDownloader(); - float getProgress() const - { + float getProgress() const { if (m_uncached_count >= 1) - return 1.0f * m_uncached_received_count / m_uncached_count; + return 1.0f * m_uncached_received_count / + m_uncached_count; return 0.0f; } - bool isStarted() const { return m_initial_step_done; } + bool isStarted() const { + return m_initial_step_done; + } // If this returns true, the downloader is done and can be deleted - bool isDone() const - { + bool isDone() const { return m_initial_step_done && - m_uncached_received_count == m_uncached_count; + m_uncached_received_count == m_uncached_count; } // Add a file to the list of required file (but don't fetch it yet) @@ -80,42 +82,44 @@ public: // Must be called for each file received through TOCLIENT_MEDIA void conventionalTransferDone( - const std::string &name, const std::string &data, Client *client); + const std::string &name, + const std::string &data, + Client *client); private: - struct FileStatus - { + struct FileStatus { bool received; std::string sha1; s32 current_remote; std::vector available_remotes; }; - struct RemoteServerStatus - { + struct RemoteServerStatus { std::string baseurl; s32 active_count; }; void initialStep(Client *client); void remoteHashSetReceived(const HTTPFetchResult &fetch_result); - void remoteMediaReceived(const HTTPFetchResult &fetch_result, Client *client); + void remoteMediaReceived(const HTTPFetchResult &fetch_result, + Client *client); s32 selectRemoteServer(FileStatus *filestatus); void startRemoteMediaTransfers(); void startConventionalTransfers(Client *client); bool checkAndLoad(const std::string &name, const std::string &sha1, - const std::string &data, bool is_from_cache, Client *client); + const std::string &data, bool is_from_cache, + Client *client); std::string serializeRequiredHashSet(); - static void deSerializeHashSet( - const std::string &data, std::set &result); + static void deSerializeHashSet(const std::string &data, + std::set &result); // Maps filename to file status - std::map m_files; + std::map m_files; // Array of remote media servers - std::vector m_remotes; + std::vector m_remotes; // Filesystem-based media cache FileCache m_media_cache; @@ -144,4 +148,5 @@ private: // don't need to be looked at again // (use m_files.upper_bound(m_name_bound) to get an iterator) std::string m_name_bound = ""; + }; -- cgit v1.2.3