Commit c48d2213 authored by Joris Guisson's avatar Joris Guisson
Browse files

Fixed bug with stalled timer, we now check on completed flag instead of bytes_left > 0

svn path=/branches/ktorrent/2.0/; revision=593297
parent 80d0e01b
......@@ -173,15 +173,17 @@ namespace bt
stats.completed = cman->chunksLeft() == 0;
if (stats.completed && !comp)
{
// download has just been completed
// only sent completed to tracker when we have all chunks (so no excluded chunks)
if (cman->haveAllChunks())
tracker->completed();
pman->killSeeders();
QDateTime now = QDateTime::currentDateTime();
running_time_dl += time_started_dl.secsTo(now);
updateStatusMsg();
updateStats();
// download has just been completed
// only sent completed to tracker when we have all chunks (so no excluded chunks)
if (cman->haveAllChunks())
tracker->completed();
finished(this);
}
else if (!stats.completed && comp)
......@@ -226,8 +228,7 @@ namespace bt
// do a manual update if we are stalled for more then 2 minutes
// we do not do this for private torrents
if (stalled_timer.getElapsedSinceUpdate() > 120000 && stats.bytes_left > 0 &&
!stats.priv_torrent)
if (stalled_timer.getElapsedSinceUpdate() > 120000 && !stats.completed && !stats.priv_torrent)
{
Out() << "Stalled for to long, time to get some fresh blood" << endl;
tracker->manualUpdate();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment