diff --git a/ChangeLog b/ChangeLog index c1a64a29..5c8e2325 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-04-07 Tatsuhiro Tsujikawa + + Fixed the bug that upload limit exceeds the value specified in + --seed-ratio option depending on the timing of the execution of + SeedCheckCommand. + * src/SeedCheckCommand.cc + 2009-04-05 Tatsuhiro Tsujikawa Fixed the bug that removed peer's session upload/download length diff --git a/src/SeedCheckCommand.cc b/src/SeedCheckCommand.cc index 48582dcd..9f24ca9f 100644 --- a/src/SeedCheckCommand.cc +++ b/src/SeedCheckCommand.cc @@ -53,7 +53,10 @@ SeedCheckCommand::SeedCheckCommand(int cuid, e(e), _btContext(btContext), seedCriteria(seedCriteria), - checkStarted(false) {} + checkStarted(false) +{ + setStatusRealtime(); +} bool SeedCheckCommand::execute() { if(_btRuntime->isHalt()) { @@ -62,18 +65,16 @@ bool SeedCheckCommand::execute() { if(!seedCriteria.get()) { return false; } - if(checkPoint.elapsed(1)) { - if(!checkStarted) { - if(_pieceStorage->downloadFinished()) { - checkStarted = true; - seedCriteria->reset(); - } + if(!checkStarted) { + if(_pieceStorage->downloadFinished()) { + checkStarted = true; + seedCriteria->reset(); } - if(checkStarted) { - if(seedCriteria->evaluate()) { - logger->notice(MSG_SEEDING_END); - _btRuntime->setHalt(true); - } + } + if(checkStarted) { + if(seedCriteria->evaluate()) { + logger->notice(MSG_SEEDING_END); + _btRuntime->setHalt(true); } } e->commands.push_back(this);