summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2009-12-13 07:45:22 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2009-12-13 07:45:22 +0000
commit15c5d12737011ce62ce0e2f592106616d5045cad (patch)
tree1b6790b5eb9c620ecdf7de4ebe99ea0e49c362d8
parentcd3552fbbb3ebed66b06584d225cb08f5f981b78 (diff)
2009-12-13 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that RequestGroupMan::downloadFinished() returns true even if all downloads haven't finished, especially when PostDownloadHandler is involved. Changed the condition so that it only returns true if both _requestGroups and _reservedGroups are empty. * src/RequestGroupMan.cc
-rw-r--r--ChangeLog9
-rw-r--r--src/RequestGroupMan.cc11
2 files changed, 10 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 23d7fc41..ddeac1be 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2009-12-13 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
+ Fixed the bug that RequestGroupMan::downloadFinished() returns
+ true even if all downloads haven't finished, especially when
+ PostDownloadHandler is involved. Changed the condition so that it
+ only returns true if both _requestGroups and _reservedGroups are
+ empty.
+ * src/RequestGroupMan.cc
+
+2009-12-13 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
+
Log listening port for BitTorrent/DHT in notice level.
* src/DHTConnectionImpl.cc
* src/PeerListenCommand.cc
diff --git a/src/RequestGroupMan.cc b/src/RequestGroupMan.cc
index d9f4bb35..02bb3070 100644
--- a/src/RequestGroupMan.cc
+++ b/src/RequestGroupMan.cc
@@ -91,16 +91,7 @@ bool RequestGroupMan::downloadFinished()
return false;
}
#endif // ENABLE_XML_RPC
- if(!_reservedGroups.empty()) {
- return false;
- }
- for(RequestGroups::iterator itr = _requestGroups.begin();
- itr != _requestGroups.end(); ++itr) {
- if((*itr)->getNumCommand() > 0 || !(*itr)->downloadFinished()) {
- return false;
- }
- }
- return true;
+ return _requestGroups.empty() && _reservedGroups.empty();
}
void RequestGroupMan::addRequestGroup(const RequestGroupHandle& group)