diff options
Diffstat (limited to 'src/RequestGroupMan.h')
| -rw-r--r-- | src/RequestGroupMan.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/RequestGroupMan.h b/src/RequestGroupMan.h index ec728d49..566b77d3 100644 --- a/src/RequestGroupMan.h +++ b/src/RequestGroupMan.h @@ -72,7 +72,13 @@ private: RequestGroupList reservedGroups_; DownloadResultList downloadResults_; - int maxSimultaneousDownloads_; + int maxConcurrentDownloads_; + + bool optimizeConcurrentDownloads_; + double optimizeConcurrentDownloadsCoeffA_; + double optimizeConcurrentDownloadsCoeffB_; + int optimizationSpeed_; + Timer optimizationSpeedTimer_; // The number of simultaneous active downloads, excluding seed only // item if PREF_BT_DETACH_SEED_ONLY is true. We rely on this @@ -135,9 +141,11 @@ private: void addRequestGroupIndex( const std::vector<std::shared_ptr<RequestGroup>>& groups); + int optimizeConcurrentDownloads(); + public: RequestGroupMan(std::vector<std::shared_ptr<RequestGroup>> requestGroups, - int maxSimultaneousDownloads, const Option* option); + int maxConcurrentDownloads, const Option* option); ~RequestGroupMan(); @@ -195,6 +203,13 @@ public: bool removeReservedGroup(a2_gid_t gid); + bool getOptimizeConcurrentDownloads() const + { + return optimizeConcurrentDownloads_; + } + + bool setupOptimizeConcurrentDownloads(); + void showDownloadResults(OutputFile& o, bool full) const; bool isSameFileBeingDownloaded(RequestGroup* requestGroup) const; @@ -291,7 +306,7 @@ public: return maxOverallUploadSpeedLimit_; } - void setMaxSimultaneousDownloads(int max) { maxSimultaneousDownloads_ = max; } + void setMaxConcurrentDownloads(int max) { maxConcurrentDownloads_ = max; } // Call this function if requestGroups_ queue should be maintained. // This function is added to reduce the call of maintenance, but at |
