Jelajahi Sumber

2008-02-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

	Fixed the bug that prevents aria2 from stopping other than by 
pressing
	Ctrl-C in BitTorrent download. It is reproducible using 
--seed-time
	option. aria2 doesn't stop even after --seed-time is satisfied 
and
	continues to output blank lines in the console.
	* src/ReceiverMSEHandshakeCommand.cc
	* src/PeerReceiveHandshakeCommand.cc
	* src/PeerListenCommand.cc
Tatsuhiro Tsujikawa 17 tahun lalu
induk
melakukan
a1f0d44c9f

+ 10 - 0
ChangeLog

@@ -1,3 +1,13 @@
+2008-02-24  Tatsuhiro Tsujikawa  <tujikawa at rednoah dot com>
+
+	Fixed the bug that prevents aria2 from stopping other than by pressing
+	Ctrl-C in BitTorrent download. It is reproducible using --seed-time
+	option. aria2 doesn't stop even after --seed-time is satisfied and
+	continues to output blank lines in the console.
+	* src/ReceiverMSEHandshakeCommand.cc
+	* src/PeerReceiveHandshakeCommand.cc
+	* src/PeerListenCommand.cc
+
 2008-02-21  Tatsuhiro Tsujikawa  <tujikawa at rednoah dot com>
 
 	Bump up version number to 0.13.0rc

+ 1 - 1
src/PeerListenCommand.cc

@@ -85,7 +85,7 @@ int32_t PeerListenCommand::bindPort(IntSequence& seq)
 }
 
 bool PeerListenCommand::execute() {
-  if(e->isHaltRequested() || e->_requestGroupMan->countRequestGroup() == 0) {
+  if(e->isHaltRequested() || e->_requestGroupMan->downloadFinished()) {
     return true;
   }
   for(int32_t i = 0; i < 3 && socket->isReadable(0); i++) {

+ 2 - 1
src/PeerReceiveHandshakeCommand.cc

@@ -51,6 +51,7 @@
 #include "Logger.h"
 #include "prefs.h"
 #include "Option.h"
+#include "RequestGroupMan.h"
 
 namespace aria2 {
 
@@ -76,7 +77,7 @@ PeerReceiveHandshakeCommand::~PeerReceiveHandshakeCommand() {}
 
 bool PeerReceiveHandshakeCommand::exitBeforeExecute()
 {
-  return e->isHaltRequested();
+  return e->isHaltRequested() || e->_requestGroupMan->downloadFinished();
 }
 
 bool PeerReceiveHandshakeCommand::executeInternal()

+ 2 - 1
src/ReceiverMSEHandshakeCommand.cc

@@ -47,6 +47,7 @@
 #include "MSEHandshake.h"
 #include "ARC4Encryptor.h"
 #include "ARC4Decryptor.h"
+#include "RequestGroupMan.h"
 
 namespace aria2 {
 
@@ -70,7 +71,7 @@ ReceiverMSEHandshakeCommand::~ReceiverMSEHandshakeCommand()
 
 bool ReceiverMSEHandshakeCommand::exitBeforeExecute()
 {
-  return e->isHaltRequested();
+  return e->isHaltRequested() || e->_requestGroupMan->downloadFinished();
 }
 
 bool ReceiverMSEHandshakeCommand::executeInternal()