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 ...@@ -173,15 +173,17 @@ namespace bt
stats.completed = cman->chunksLeft() == 0; stats.completed = cman->chunksLeft() == 0;
if (stats.completed && !comp) 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(); pman->killSeeders();
QDateTime now = QDateTime::currentDateTime(); QDateTime now = QDateTime::currentDateTime();
running_time_dl += time_started_dl.secsTo(now); running_time_dl += time_started_dl.secsTo(now);
updateStatusMsg(); updateStatusMsg();
updateStats(); 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); finished(this);
} }
else if (!stats.completed && comp) else if (!stats.completed && comp)
...@@ -226,8 +228,7 @@ namespace bt ...@@ -226,8 +228,7 @@ namespace bt
// do a manual update if we are stalled for more then 2 minutes // do a manual update if we are stalled for more then 2 minutes
// we do not do this for private torrents // we do not do this for private torrents
if (stalled_timer.getElapsedSinceUpdate() > 120000 && stats.bytes_left > 0 && if (stalled_timer.getElapsedSinceUpdate() > 120000 && !stats.completed && !stats.priv_torrent)
!stats.priv_torrent)
{ {
Out() << "Stalled for to long, time to get some fresh blood" << endl; Out() << "Stalled for to long, time to get some fresh blood" << endl;
tracker->manualUpdate(); 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