Prechádzať zdrojové kódy

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
Tatsuhiro Tsujikawa 16 rokov pred
rodič
commit
69c3dfded4

+ 9 - 0
ChangeLog

@@ -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>
 
 	Fixed compile error regarding BUFSIZE.

+ 3 - 3
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 <http://docbook.sf.net/>
-.\"      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

+ 3 - 4
doc/aria2c.1.html

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

+ 2 - 3
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

+ 0 - 1
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);

+ 1 - 8
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();
   }
 }

+ 0 - 8
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

+ 3 - 3
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.")