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
pull/1/head
Tatsuhiro Tsujikawa 2009-07-06 13:36:16 +00:00
parent 4f96c37ade
commit 69c3dfded4
8 changed files with 21 additions and 30 deletions

View File

@ -1,3 +1,12 @@
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
2009-07-05 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> 2009-07-05 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed compile error regarding BUFSIZE. Fixed compile error regarding BUFSIZE.

View File

@ -2,12 +2,12 @@
.\" Title: aria2c .\" Title: aria2c
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.75.0 <http://docbook.sf.net/> .\" Generator: DocBook XSL Stylesheets v1.75.0 <http://docbook.sf.net/>
.\" Date: 07/05/2009 .\" Date: 07/06/2009
.\" Manual: Aria2 Manual .\" Manual: Aria2 Manual
.\" Source: Aria2 .\" Source: Aria2
.\" Language: English .\" Language: English
.\" .\"
.TH "ARIA2C" "1" "07/05/2009" "Aria2" "Aria2 Manual" .TH "ARIA2C" "1" "07/06/2009" "Aria2" "Aria2 Manual"
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
.\" * set default formatting .\" * set default formatting
.\" ----------------------------------------------------------------- .\" -----------------------------------------------------------------
@ -538,7 +538,7 @@ Seed previously downloaded files without verifying piece hashes\&. Default:
.PP .PP
\fB\-\-bt\-stop\-timeout\fR=SEC \fB\-\-bt\-stop\-timeout\fR=SEC
.RS 4 .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 \fI0\fR
is given, this feature is disabled\&. Default: is given, this feature is disabled\&. Default:
\fI0\fR \fI0\fR

View File

@ -1103,9 +1103,8 @@ writes the piece to the appropriate files.</td>
</dt> </dt>
<dd> <dd>
<p> <p>
Stop BitTorrent download if download speed is 0 and the number of Stop BitTorrent download if download speed is 0 in consecutive NUM
seeder is 0 in consecutive NUM seconds. If <em>0</em> is given, this seconds. If <em>0</em> is given, this feature is disabled. Default: <em>0</em>
feature is disabled. Default: <em>0</em>
</p> </p>
</dd> </dd>
<dt class="hdlist1"> <dt class="hdlist1">
@ -3197,7 +3196,7 @@ files in the program, then also delete it here.</p></div>
</div> </div>
<div id="footer"> <div id="footer">
<div id="footer-text"> <div id="footer-text">
Last updated 2009-07-05 18:30:39 JST Last updated 2009-07-06 22:33:35 JST
</div> </div>
</div> </div>
</body> </body>

View File

@ -379,9 +379,8 @@ BitTorrent Specific Options
*--bt-stop-timeout*=SEC:: *--bt-stop-timeout*=SEC::
Stop BitTorrent download if download speed is 0 and the number of Stop BitTorrent download if download speed is 0 in consecutive NUM
seeder is 0 in consecutive NUM seconds. If '0' is given, this seconds. If '0' is given, this feature is disabled. Default: '0'
feature is disabled. Default: '0'
*--bt-tracker-interval*=SEC:: *--bt-tracker-interval*=SEC::
Set the interval in seconds between tracker requests. This Set the interval in seconds between tracker requests. This

View File

@ -165,7 +165,6 @@ void BtSetup::setup(std::deque<Command*>& commands,
new BtStopDownloadCommand(e->newCUID(), requestGroup, e, btStopTimeout); new BtStopDownloadCommand(e->newCUID(), requestGroup, e, btStopTimeout);
stopDownloadCommand->setBtRuntime(btRuntime); stopDownloadCommand->setBtRuntime(btRuntime);
stopDownloadCommand->setPieceStorage(pieceStorage); stopDownloadCommand->setPieceStorage(pieceStorage);
stopDownloadCommand->setPeerStorage(peerStorage);
commands.push_back(stopDownloadCommand); commands.push_back(stopDownloadCommand);
} }
btRuntime->setReady(true); btRuntime->setReady(true);

View File

@ -34,7 +34,6 @@
/* copyright --> */ /* copyright --> */
#include "BtStopDownloadCommand.h" #include "BtStopDownloadCommand.h"
#include "PieceStorage.h" #include "PieceStorage.h"
#include "PeerStorage.h"
#include "RequestGroup.h" #include "RequestGroup.h"
#include "BtRuntime.h" #include "BtRuntime.h"
#include "Peer.h" #include "Peer.h"
@ -68,13 +67,7 @@ void BtStopDownloadCommand::preProcess()
void BtStopDownloadCommand::process() void BtStopDownloadCommand::process()
{ {
if(_requestGroup->calculateStat().getDownloadSpeed() == 0) { if(_requestGroup->calculateStat().getDownloadSpeed() > 0) {
std::deque<SharedHandle<Peer> > activePeers;
_peerStorage->getActivePeers(activePeers);
if(countSeeder(activePeers.begin(), activePeers.end()) != 0) {
_checkPoint.reset();
}
} else {
_checkPoint.reset(); _checkPoint.reset();
} }
} }

View File

@ -42,7 +42,6 @@ namespace aria2 {
class RequestGroup; class RequestGroup;
class PieceStorage; class PieceStorage;
class PeerStorage;
class BtRuntime; class BtRuntime;
// Stop downloading torrent if in consecutive _timeout seconds, // Stop downloading torrent if in consecutive _timeout seconds,
@ -57,8 +56,6 @@ private:
SharedHandle<BtRuntime> _btRuntime; SharedHandle<BtRuntime> _btRuntime;
SharedHandle<PeerStorage> _peerStorage;
SharedHandle<PieceStorage> _pieceStorage; SharedHandle<PieceStorage> _pieceStorage;
public: public:
BtStopDownloadCommand BtStopDownloadCommand
@ -80,11 +77,6 @@ public:
{ {
_pieceStorage = pieceStorage; _pieceStorage = pieceStorage;
} }
void setPeerStorage(const SharedHandle<PeerStorage>& peerStorage)
{
_peerStorage = peerStorage;
}
}; };
} // namespace aria2 } // namespace aria2

View File

@ -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"\ " See --on-download-start option for the\n"\
" requirement of COMMAND.") " requirement of COMMAND.")
#define TEXT_BT_STOP_TIMEOUT \ #define TEXT_BT_STOP_TIMEOUT \
_(" --bt-stop-timeout=SEC Stop BitTorrent download if download speed is 0\n"\ _(" --bt-stop-timeout=SEC Stop BitTorrent download if download speed is 0 in\n"\
" and the number of seeder is 0 in consecutive NUM\n"\ " consecutive NUM seconds. If 0 is given, this\n"\
" seconds. If 0 is given, this feature is disabled.") " feature is disabled.")