if the download speed of a file is under a certain value, dc automatically
disconnect from that user (so if I have a list of alternate users it will
automatically try with another one).
If after a certain number of tries no connection is possible, then that value decrements (so that after or before I'll download from someone).
After a given amout of time the value could raise again so that dc
tries again to find some faster user.
THIS WOULD BE VERY HELPFUL BECAUSE:
- download are optimezed->net is less crowded -> files are retrieved faster
- who can download fast downloads fast, who can download slow still
downloads slow
This is very very easy to achieve, I would have done it by myself (I'm a c++ programmer) but currently I cannot setup the development environment on my pc. However I looked at the code:
method:
Code: Select all
DownloadManager::checkDownloads(UserConnection* aConn)(since the max upload limit is quite unusefull for me I propose to use
that parameter for the Min upload limit)
the modification to do is:
OLD CODE:
Code: Select all
if( ((SETTING(DOWNLOAD_SLOTS) != 0) && getDownloads() >= SETTING(DOWNLOAD_SLOTS)) ||
((SETTING(MAX_DOWNLOAD_SPEED) != 0 && getAverageSpeed() >= (SETTING(MAX_DOWNLOAD_SPEED)*1024)) ) ) {
if(!QueueManager::getInstance()->hasDownload(aConn->getUser(), QueueItem::HIGHEST)) {
removeConnection(aConn);
return;
}
}NEW CODE:
add variables:
Code: Select all
int numberOfTrials = 10; (or configurable)
currentTrial = 0;
if (currentTrial == numberOfTrials)
{
currentTrial = 0;
decreaseMinDownladSpeed(): (method that will decrease the MIN_DOWNLOAD_SPEED value)
}
if( ((SETTING(DOWNLOAD_SLOTS) != 0) && getDownloads() >= SETTING(DOWNLOAD_SLOTS)) ||
(((SETTING(MIN_DOWNLOAD_SPEED)!= 0 && getAverageSpeed() < (((SETTING(MIN_DOWNLOAD_SPEED)*1024)) ) ) {
if(!QueueManager::getInstance()->hasDownload(aConn->getUser(), QueueItem::HIGHEST)) {
removeConnection(aConn);
currentTrial++;
return;
}
}
and then a method shall be added so that every x minutes the
MIN_DOWNLOAD_SPEED is raised again to the original value.