diff --git a/ChangeLog b/ChangeLog index e9565a3d..3d44048a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-07-06 Tatsuhiro Tsujikawa + + --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 + 2009-07-05 Tatsuhiro Tsujikawa Fixed compile error regarding BUFSIZE. diff --git a/doc/aria2c.1 b/doc/aria2c.1 index dfe732a1..001d72f5 100644 --- a/doc/aria2c.1 +++ b/doc/aria2c.1 @@ -2,12 +2,12 @@ .\" Title: aria2c .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.0 -.\" Date: 07/05/2009 +.\" Date: 07/06/2009 .\" Manual: Aria2 Manual .\" Source: Aria2 .\" Language: English .\" -.TH "ARIA2C" "1" "07/05/2009" "Aria2" "Aria2 Manual" +.TH "ARIA2C" "1" "07/06/2009" "Aria2" "Aria2 Manual" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- @@ -538,7 +538,7 @@ Seed previously downloaded files without verifying piece hashes\&. Default: .PP \fB\-\-bt\-stop\-timeout\fR=SEC .RS 4 -Stop BitTorrent download if download speed is 0 and the number of seeder is 0 in consecutive NUM seconds\&. If +Stop BitTorrent download if download speed is 0 in consecutive NUM seconds\&. If \fI0\fR is given, this feature is disabled\&. Default: \fI0\fR diff --git a/doc/aria2c.1.html b/doc/aria2c.1.html index df92d2dc..b91d27e7 100644 --- a/doc/aria2c.1.html +++ b/doc/aria2c.1.html @@ -1103,9 +1103,8 @@ writes the piece to the appropriate files.

- Stop BitTorrent download if download speed is 0 and the number of - seeder is 0 in consecutive NUM seconds. If 0 is given, this - feature is disabled. Default: 0 + Stop BitTorrent download if download speed is 0 in consecutive NUM + seconds. If 0 is given, this feature is disabled. Default: 0

@@ -3197,7 +3196,7 @@ files in the program, then also delete it here.

diff --git a/doc/aria2c.1.txt b/doc/aria2c.1.txt index 02a7d535..4839b5b5 100644 --- a/doc/aria2c.1.txt +++ b/doc/aria2c.1.txt @@ -379,9 +379,8 @@ BitTorrent Specific Options *--bt-stop-timeout*=SEC:: - Stop BitTorrent download if download speed is 0 and the number of - seeder is 0 in consecutive NUM seconds. If '0' is given, this - feature is disabled. Default: '0' + Stop BitTorrent download if download speed is 0 in consecutive NUM + seconds. If '0' is given, this feature is disabled. Default: '0' *--bt-tracker-interval*=SEC:: Set the interval in seconds between tracker requests. This 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& 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 > 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; - SharedHandle _peerStorage; - SharedHandle _pieceStorage; public: BtStopDownloadCommand @@ -80,11 +77,6 @@ public: { _pieceStorage = pieceStorage; } - - void setPeerStorage(const SharedHandle& 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.")