diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2009-07-06 13:36:16 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2009-07-06 13:36:16 +0000 |
| commit | 69c3dfded4f2816ce734828e3a7dbae6caf32a8e (patch) | |
| tree | 94b646421fe00ac9752c460ad94050cdd3dcf566 /src | |
| parent | 4f96c37ade75ad373f66bba4f08d632a6418054d (diff) | |
2009-07-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
--bt-stop-timeout now only checks download speed.
* src/BtStopDownloadCommand.cc
* src/BtStopDownloadCommand.h
* src/BtSetup.cc
* src/usage_text.h
* doc/aria2c.1.txt
Diffstat (limited to 'src')
| -rw-r--r-- | src/BtSetup.cc | 1 | ||||
| -rw-r--r-- | src/BtStopDownloadCommand.cc | 9 | ||||
| -rw-r--r-- | src/BtStopDownloadCommand.h | 8 | ||||
| -rw-r--r-- | src/usage_text.h | 6 |
4 files changed, 4 insertions, 20 deletions
diff --git a/src/BtSetup.cc b/src/BtSetup.cc index 2f242548..4754859a 100644 --- a/src/BtSetup.cc +++ b/src/BtSetup.cc @@ -165,7 +165,6 @@ void BtSetup::setup(std::deque<Command*>& commands, new BtStopDownloadCommand(e->newCUID(), requestGroup, e, btStopTimeout); stopDownloadCommand->setBtRuntime(btRuntime); stopDownloadCommand->setPieceStorage(pieceStorage); - stopDownloadCommand->setPeerStorage(peerStorage); commands.push_back(stopDownloadCommand); } btRuntime->setReady(true); diff --git a/src/BtStopDownloadCommand.cc b/src/BtStopDownloadCommand.cc index b61f226c..9233c872 100644 --- a/src/BtStopDownloadCommand.cc +++ b/src/BtStopDownloadCommand.cc @@ -34,7 +34,6 @@ /* copyright --> */ #include "BtStopDownloadCommand.h" #include "PieceStorage.h" -#include "PeerStorage.h" #include "RequestGroup.h" #include "BtRuntime.h" #include "Peer.h" @@ -68,13 +67,7 @@ void BtStopDownloadCommand::preProcess() void BtStopDownloadCommand::process() { - if(_requestGroup->calculateStat().getDownloadSpeed() == 0) { - std::deque<SharedHandle<Peer> > activePeers; - _peerStorage->getActivePeers(activePeers); - if(countSeeder(activePeers.begin(), activePeers.end()) != 0) { - _checkPoint.reset(); - } - } else { + if(_requestGroup->calculateStat().getDownloadSpeed() > 0) { _checkPoint.reset(); } } diff --git a/src/BtStopDownloadCommand.h b/src/BtStopDownloadCommand.h index c5f7d99b..d1b850c8 100644 --- a/src/BtStopDownloadCommand.h +++ b/src/BtStopDownloadCommand.h @@ -42,7 +42,6 @@ namespace aria2 { class RequestGroup; class PieceStorage; -class PeerStorage; class BtRuntime; // Stop downloading torrent if in consecutive _timeout seconds, @@ -57,8 +56,6 @@ private: SharedHandle<BtRuntime> _btRuntime; - SharedHandle<PeerStorage> _peerStorage; - SharedHandle<PieceStorage> _pieceStorage; public: BtStopDownloadCommand @@ -80,11 +77,6 @@ public: { _pieceStorage = pieceStorage; } - - void setPeerStorage(const SharedHandle<PeerStorage>& peerStorage) - { - _peerStorage = peerStorage; - } }; } // namespace aria2 diff --git a/src/usage_text.h b/src/usage_text.h index 44920b8f..f348d720 100644 --- a/src/usage_text.h +++ b/src/usage_text.h @@ -559,6 +559,6 @@ _(" --on-download-stop=COMMAND Set the command to be executed when download\n" " See --on-download-start option for the\n"\ " requirement of COMMAND.") #define TEXT_BT_STOP_TIMEOUT \ -_(" --bt-stop-timeout=SEC Stop BitTorrent download if download speed is 0\n"\ - " and the number of seeder is 0 in consecutive NUM\n"\ - " seconds. If 0 is given, this feature is disabled.") +_(" --bt-stop-timeout=SEC Stop BitTorrent download if download speed is 0 in\n"\ + " consecutive NUM seconds. If 0 is given, this\n"\ + " feature is disabled.") |
