Преглед на файлове

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
Tatsuhiro Tsujikawa преди 16 години
родител
ревизия
15c5d12737
променени са 2 файла, в които са добавени 10 реда и са изтрити 10 реда
  1. 9 0
      ChangeLog
  2. 1 10
      src/RequestGroupMan.cc

+ 9 - 0
ChangeLog

@@ -1,3 +1,12 @@
+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.

+ 1 - 10
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)