Browse Source

2009-01-24 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

	Made (piece) hash check sequential for each RequestGroup because
	simultaneous hash check is slower than sequential execution.	
	* src/CheckIntegrityCommand.cc
	* src/CheckIntegrityDispatcherCommand.cc
	* src/CheckIntegrityDispatcherCommand.h
	* src/CheckIntegrityMan.h
	* src/ConsoleStatCalc.cc
	* src/DownloadCommand.cc
	* src/DownloadEngine.cc
	* src/DownloadEngine.h
	* src/DownloadEngineFactory.cc
	* src/Makefile.am
	* src/Makefile.in
	* src/RequestGroup.cc
	* src/StatCalc.h
Tatsuhiro Tsujikawa 16 năm trước cách đây
mục cha
commit
adf91f656b

+ 18 - 0
ChangeLog

@@ -1,3 +1,21 @@
+2009-01-24  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
+
+	Made (piece) hash check sequential for each RequestGroup because
+	simultaneous hash check is slower than sequential execution.	
+	* src/CheckIntegrityCommand.cc
+	* src/CheckIntegrityDispatcherCommand.cc
+	* src/CheckIntegrityDispatcherCommand.h
+	* src/CheckIntegrityMan.h
+	* src/ConsoleStatCalc.cc
+	* src/DownloadCommand.cc
+	* src/DownloadEngine.cc
+	* src/DownloadEngine.h
+	* src/DownloadEngineFactory.cc
+	* src/Makefile.am
+	* src/Makefile.in
+	* src/RequestGroup.cc
+	* src/StatCalc.h
+	
 2009-01-24  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
 
 	Moved setStatusRealtime() from FileAllocationDispatcherCommand to

+ 10 - 10
src/CheckIntegrityCommand.cc

@@ -33,7 +33,6 @@
  */
 /* copyright --> */
 #include "CheckIntegrityCommand.h"
-#include "CheckIntegrityMan.h"
 #include "CheckIntegrityEntry.h"
 #include "DownloadEngine.h"
 #include "RequestGroup.h"
@@ -43,17 +42,14 @@
 
 namespace aria2 {
 
-CheckIntegrityCommand::CheckIntegrityCommand(int32_t cuid, RequestGroup* requestGroup, DownloadEngine* e, const CheckIntegrityEntryHandle& entry):
+CheckIntegrityCommand::CheckIntegrityCommand
+(int32_t cuid, RequestGroup* requestGroup, DownloadEngine* e,
+ const CheckIntegrityEntryHandle& entry):
   RealtimeCommand(cuid, requestGroup, e),
   _entry(entry)
-{
-  _e->_checkIntegrityMan->addCheckIntegrityEntry(_entry);
-}
+{}
 
-CheckIntegrityCommand::~CheckIntegrityCommand()
-{
-  _e->_checkIntegrityMan->removeCheckIntegrityEntry(_entry);
-}
+CheckIntegrityCommand::~CheckIntegrityCommand() {}
 
 bool CheckIntegrityCommand::executeInternal()
 {
@@ -62,6 +58,8 @@ bool CheckIntegrityCommand::executeInternal()
   }
   _entry->validateChunk();
   if(_entry->finished()) {
+    _e->_checkIntegrityMan->dropPickedEntry();
+
     if(_requestGroup->downloadFinished()) {
       logger->notice(MSG_VERIFICATION_SUCCESSFUL,
 		     _requestGroup->getFilePath().c_str());
@@ -85,8 +83,10 @@ bool CheckIntegrityCommand::executeInternal()
 
 bool CheckIntegrityCommand::handleException(Exception& e)
 {
+  _e->_checkIntegrityMan->dropPickedEntry();
   logger->error(MSG_FILE_VALIDATION_FAILURE, e, cuid);
-  logger->error(MSG_DOWNLOAD_NOT_COMPLETE, cuid, _requestGroup->getFilePath().c_str());
+  logger->error(MSG_DOWNLOAD_NOT_COMPLETE,
+		cuid, _requestGroup->getFilePath().c_str());
   return true;
 }
 

+ 62 - 0
src/CheckIntegrityDispatcherCommand.cc

@@ -0,0 +1,62 @@
+/* <!-- copyright */
+/*
+ * aria2 - The high speed download utility
+ *
+ * Copyright (C) 2009 Tatsuhiro Tsujikawa
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ * In addition, as a special exception, the copyright holders give
+ * permission to link the code of portions of this program with the
+ * OpenSSL library under certain conditions as described in each
+ * individual source file, and distribute linked combinations
+ * including the two.
+ * You must obey the GNU General Public License in all respects
+ * for all of the code used other than OpenSSL.  If you modify
+ * file(s) with this exception, you may extend this exception to your
+ * version of the file(s), but you are not obligated to do so.  If you
+ * do not wish to do so, delete this exception statement from your
+ * version.  If you delete this exception statement from all source
+ * files in the program, then also delete it here.
+ */
+/* copyright --> */
+#include "CheckIntegrityDispatcherCommand.h"
+#include "CheckIntegrityEntry.h"
+#include "CheckIntegrityCommand.h"
+#include "message.h"
+#include "Logger.h"
+
+namespace aria2 {
+
+CheckIntegrityDispatcherCommand::CheckIntegrityDispatcherCommand
+(int32_t cuid,
+ const SharedHandle<CheckIntegrityMan>& fileAllocMan,
+ DownloadEngine* e):SequentialDispatcherCommand<CheckIntegrityEntry>
+		    (cuid, fileAllocMan, e)
+{
+  setStatusRealtime();
+}
+
+Command* CheckIntegrityDispatcherCommand::createCommand
+(const SharedHandle<CheckIntegrityEntry>& entry)
+{
+  int32_t newCUID = _e->newCUID();
+  logger->info("CUID#%d - Dispatching CheckIntegrityCommand CUID#%d.",
+	       cuid, newCUID);
+  return new CheckIntegrityCommand
+    (newCUID, entry->getRequestGroup(), _e, entry);
+}
+
+} // namespace aria2

+ 59 - 0
src/CheckIntegrityDispatcherCommand.h

@@ -0,0 +1,59 @@
+/* <!-- copyright */
+/*
+ * aria2 - The high speed download utility
+ *
+ * Copyright (C) 2009 Tatsuhiro Tsujikawa
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ * In addition, as a special exception, the copyright holders give
+ * permission to link the code of portions of this program with the
+ * OpenSSL library under certain conditions as described in each
+ * individual source file, and distribute linked combinations
+ * including the two.
+ * You must obey the GNU General Public License in all respects
+ * for all of the code used other than OpenSSL.  If you modify
+ * file(s) with this exception, you may extend this exception to your
+ * version of the file(s), but you are not obligated to do so.  If you
+ * do not wish to do so, delete this exception statement from your
+ * version.  If you delete this exception statement from all source
+ * files in the program, then also delete it here.
+ */
+/* copyright --> */
+#ifndef _D_CHECK_INTEGRITY_DISPATCHER_COMMAND_H_
+#define _D_CHECK_INTEGRITY_DISPATCHER_COMMAND_H_
+
+#include "SequentialDispatcherCommand.h"
+#include "CheckIntegrityMan.h"
+
+namespace aria2 {
+
+class CheckIntegrityEntry;
+
+class CheckIntegrityDispatcherCommand :
+    public SequentialDispatcherCommand<CheckIntegrityEntry> {
+public:
+  CheckIntegrityDispatcherCommand
+  (int32_t cuid,
+   const SharedHandle<CheckIntegrityMan>& checkMan,
+   DownloadEngine* e);
+protected:
+  virtual Command* createCommand
+  (const SharedHandle<CheckIntegrityEntry>& entry);
+};
+
+} // namespace aria2
+
+#endif // _D_CHECK_INTEGRITY_DISPATCHER_COMMAND_H_

+ 2 - 20
src/CheckIntegrityMan.h

@@ -36,31 +36,13 @@
 #define _D_CHECK_INTEGRITY_MAN_H_
 
 #include "common.h"
-#include "SharedHandle.h"
-#include <deque>
+#include "SequentialPicker.h"
 
 namespace aria2 {
 
 class CheckIntegrityEntry;
 
-class CheckIntegrityMan {
-private:
-  std::deque<SharedHandle<CheckIntegrityEntry> > _checkIntegrityEntries;
-public:
-  CheckIntegrityMan();
-
-  ~CheckIntegrityMan();
-
-  void addCheckIntegrityEntry(const SharedHandle<CheckIntegrityEntry>& entry);
-
-  bool removeCheckIntegrityEntry(const SharedHandle<CheckIntegrityEntry>& entry);
-
-  SharedHandle<CheckIntegrityEntry> getFirstCheckIntegrityEntry() const;
-
-  size_t countCheckIntegrityEntry() const;
-};
-
-typedef SharedHandle<CheckIntegrityMan> CheckIntegrityManHandle;
+typedef SequentialPicker<CheckIntegrityEntry> CheckIntegrityMan;
 
 } // namespace aria2
 

+ 5 - 5
src/ConsoleStatCalc.cc

@@ -165,7 +165,7 @@ void
 ConsoleStatCalc::calculateStat
 (const RequestGroupManHandle& requestGroupMan,
  const SharedHandle<FileAllocationMan>& fileAllocationMan,
- const CheckIntegrityManHandle& checkIntegrityMan)
+ const SharedHandle<CheckIntegrityMan>& checkIntegrityMan)
 {
   if(!_cp.elapsed(1)) {
     return;
@@ -239,7 +239,7 @@ ConsoleStatCalc::calculateStat
   }
 #ifdef ENABLE_MESSAGE_DIGEST
   {
-    CheckIntegrityEntryHandle entry = checkIntegrityMan->getFirstCheckIntegrityEntry();
+    CheckIntegrityEntryHandle entry = checkIntegrityMan->getPickedEntry();
     if(!entry.isNull()) {
       o << " "
 	<< "[Checksum:"
@@ -253,10 +253,10 @@ ConsoleStatCalc::calculateStat
 	<< 100*entry->getCurrentLength()/entry->getTotalLength()
 	<< "%)"
 	<< "]";
-      if(checkIntegrityMan->countCheckIntegrityEntry() > 1) {
+      if(checkIntegrityMan->hasNext()) {
 	o << "("
-	  << checkIntegrityMan->countCheckIntegrityEntry()-1
-	  << "more...)";
+	  << checkIntegrityMan->countEntryInQueue()
+	  << "waiting...)";
       }
     }
   }

+ 2 - 3
src/DownloadCommand.cc

@@ -254,9 +254,8 @@ bool DownloadCommand::prepareForNextSegment() {
     CheckIntegrityEntryHandle entry(new ChecksumCheckIntegrityEntry(_requestGroup));
     if(entry->isValidationReady()) {
       entry->initValidator();
-      CheckIntegrityCommand* command =
-	new CheckIntegrityCommand(e->newCUID(), _requestGroup, e, entry);
-      e->commands.push_back(command);
+      // TODO do we need cuttrailinggarbage here?
+      e->_checkIntegrityMan->pushEntry(entry);
     }
     e->setNoWait(true);
     e->setRefreshInterval(0);

+ 1 - 1
src/DownloadEngine.cc

@@ -44,7 +44,6 @@
 #include "StatCalc.h"
 #include "RequestGroup.h"
 #include "RequestGroupMan.h"
-#include "CheckIntegrityMan.h"
 #include "DownloadResult.h"
 #include "StatCalc.h"
 #include "LogFactory.h"
@@ -65,6 +64,7 @@
 #include "EventPoll.h"
 #include "Command.h"
 #include "FileAllocationEntry.h"
+#include "CheckIntegrityEntry.h"
 
 #include "BtRegistry.h"
 #include "BtContext.h"

+ 1 - 1
src/DownloadEngine.h

@@ -50,6 +50,7 @@
 #endif // ENABLE_ASYNC_DNS
 #include "CUIDCounter.h"
 #include "FileAllocationMan.h"
+#include "CheckIntegrityMan.h"
 
 namespace aria2 {
 
@@ -57,7 +58,6 @@ class Logger;
 class Option;
 class RequestGroupMan;
 class StatCalc;
-class CheckIntegrityMan;
 class SocketCore;
 class CookieStorage;
 class BtRegistry;

+ 7 - 0
src/DownloadEngineFactory.cc

@@ -45,6 +45,8 @@
 #include "FileAllocationMan.h"
 #ifdef ENABLE_MESSAGE_DIGEST
 # include "CheckIntegrityMan.h"
+# include "CheckIntegrityEntry.h"
+# include "CheckIntegrityDispatcherCommand.h"
 #endif // ENABLE_MESSAGE_DIGEST
 #include "prefs.h"
 #include "FillRequestGroupCommand.h"
@@ -118,6 +120,11 @@ DownloadEngineFactory::newDownloadEngine(Option* op,
   e->addRoutineCommand(new FillRequestGroupCommand(e->newCUID(), e.get(), 1));
   e->addRoutineCommand(new FileAllocationDispatcherCommand
 		       (e->newCUID(), e->_fileAllocationMan, e.get()));
+#ifdef ENABLE_MESSAGE_DIGEST
+  e->addRoutineCommand(new CheckIntegrityDispatcherCommand
+		       (e->newCUID(), e->_checkIntegrityMan, e.get()));
+#endif // ENABLE_MESSAGE_DIGEST
+
   if(op->getAsInt(PREF_AUTO_SAVE_INTERVAL) > 0) {
     e->addRoutineCommand
       (new AutoSaveCommand(e->newCUID(), e.get(),

+ 2 - 1
src/Makefile.am

@@ -135,7 +135,7 @@ SRCS =  Socket.h\
 	MemoryBufferPreDownloadHandler.cc MemoryBufferPreDownloadHandler.h\
 	HaveEraseCommand.cc HaveEraseCommand.h\
 	Piece.cc Piece.h\
-	CheckIntegrityMan.cc CheckIntegrityMan.h\
+	CheckIntegrityMan.h\
 	CheckIntegrityEntry.cc CheckIntegrityEntry.h\
 	PieceHashCheckIntegrityEntry.cc PieceHashCheckIntegrityEntry.h\
 	StreamCheckIntegrityEntry.cc StreamCheckIntegrityEntry.h\
@@ -233,6 +233,7 @@ endif # ENABLE_ASYNC_DNS
 if ENABLE_MESSAGE_DIGEST
 SRCS += IteratableChunkChecksumValidator.cc IteratableChunkChecksumValidator.h\
 	IteratableChecksumValidator.cc IteratableChecksumValidator.h\
+	CheckIntegrityDispatcherCommand.cc CheckIntegrityDispatcherCommand.h\
 	CheckIntegrityCommand.cc CheckIntegrityCommand.h\
 	ChecksumCheckIntegrityEntry.cc ChecksumCheckIntegrityEntry.h\
 	messageDigest.cc messageDigest.h\

+ 32 - 30
src/Makefile.in

@@ -44,6 +44,7 @@ bin_PROGRAMS = aria2c$(EXEEXT)
 @ENABLE_ASYNC_DNS_TRUE@am__append_7 = AsyncNameResolver.cc AsyncNameResolver.h
 @ENABLE_MESSAGE_DIGEST_TRUE@am__append_8 = IteratableChunkChecksumValidator.cc IteratableChunkChecksumValidator.h\
 @ENABLE_MESSAGE_DIGEST_TRUE@	IteratableChecksumValidator.cc IteratableChecksumValidator.h\
+@ENABLE_MESSAGE_DIGEST_TRUE@	CheckIntegrityDispatcherCommand.cc CheckIntegrityDispatcherCommand.h\
 @ENABLE_MESSAGE_DIGEST_TRUE@	CheckIntegrityCommand.cc CheckIntegrityCommand.h\
 @ENABLE_MESSAGE_DIGEST_TRUE@	ChecksumCheckIntegrityEntry.cc ChecksumCheckIntegrityEntry.h\
 @ENABLE_MESSAGE_DIGEST_TRUE@	messageDigest.cc messageDigest.h\
@@ -375,17 +376,16 @@ am__libaria2c_a_SOURCES_DIST = Socket.h SocketCore.cc SocketCore.h \
 	DownloadHandlerConstants.h DownloadHandlerFactory.cc \
 	DownloadHandlerFactory.h MemoryBufferPreDownloadHandler.cc \
 	MemoryBufferPreDownloadHandler.h HaveEraseCommand.cc \
-	HaveEraseCommand.h Piece.cc Piece.h CheckIntegrityMan.cc \
-	CheckIntegrityMan.h CheckIntegrityEntry.cc \
-	CheckIntegrityEntry.h PieceHashCheckIntegrityEntry.cc \
-	PieceHashCheckIntegrityEntry.h StreamCheckIntegrityEntry.cc \
-	StreamCheckIntegrityEntry.h IteratableValidator.h \
-	DiskAdaptor.cc DiskAdaptor.h AbstractSingleDiskAdaptor.cc \
-	AbstractSingleDiskAdaptor.h CopyDiskAdaptor.cc \
-	CopyDiskAdaptor.h DirectDiskAdaptor.cc DirectDiskAdaptor.h \
-	MultiDiskAdaptor.cc MultiDiskAdaptor.h Peer.cc \
-	PeerSessionResource.cc PeerSessionResource.h BtRegistry.cc \
-	BtRegistry.h MultiFileAllocationIterator.cc \
+	HaveEraseCommand.h Piece.cc Piece.h CheckIntegrityMan.h \
+	CheckIntegrityEntry.cc CheckIntegrityEntry.h \
+	PieceHashCheckIntegrityEntry.cc PieceHashCheckIntegrityEntry.h \
+	StreamCheckIntegrityEntry.cc StreamCheckIntegrityEntry.h \
+	IteratableValidator.h DiskAdaptor.cc DiskAdaptor.h \
+	AbstractSingleDiskAdaptor.cc AbstractSingleDiskAdaptor.h \
+	CopyDiskAdaptor.cc CopyDiskAdaptor.h DirectDiskAdaptor.cc \
+	DirectDiskAdaptor.h MultiDiskAdaptor.cc MultiDiskAdaptor.h \
+	Peer.cc PeerSessionResource.cc PeerSessionResource.h \
+	BtRegistry.cc BtRegistry.h MultiFileAllocationIterator.cc \
 	MultiFileAllocationIterator.h PeerConnection.cc \
 	PeerConnection.h ByteArrayDiskWriter.cc ByteArrayDiskWriter.h \
 	ByteArrayDiskWriterFactory.cc ByteArrayDiskWriterFactory.h \
@@ -422,12 +422,14 @@ am__libaria2c_a_SOURCES_DIST = Socket.h SocketCore.cc SocketCore.h \
 	AsyncNameResolver.h IteratableChunkChecksumValidator.cc \
 	IteratableChunkChecksumValidator.h \
 	IteratableChecksumValidator.cc IteratableChecksumValidator.h \
-	CheckIntegrityCommand.cc CheckIntegrityCommand.h \
-	ChecksumCheckIntegrityEntry.cc ChecksumCheckIntegrityEntry.h \
-	messageDigest.cc messageDigest.h MessageDigestHelper.cc \
-	MessageDigestHelper.h Checksum.h ChunkChecksum.h \
-	PeerMessageUtil.cc PeerMessageUtil.h PeerAbstractCommand.cc \
-	PeerAbstractCommand.h PeerInitiateConnectionCommand.cc \
+	CheckIntegrityDispatcherCommand.cc \
+	CheckIntegrityDispatcherCommand.h CheckIntegrityCommand.cc \
+	CheckIntegrityCommand.h ChecksumCheckIntegrityEntry.cc \
+	ChecksumCheckIntegrityEntry.h messageDigest.cc messageDigest.h \
+	MessageDigestHelper.cc MessageDigestHelper.h Checksum.h \
+	ChunkChecksum.h PeerMessageUtil.cc PeerMessageUtil.h \
+	PeerAbstractCommand.cc PeerAbstractCommand.h \
+	PeerInitiateConnectionCommand.cc \
 	PeerInitiateConnectionCommand.h PeerInteractionCommand.cc \
 	PeerInteractionCommand.h Peer.h PeerListenCommand.cc \
 	PeerListenCommand.h RequestSlot.cc RequestSlot.h \
@@ -581,6 +583,7 @@ am__objects_2 =
 @ENABLE_ASYNC_DNS_TRUE@am__objects_7 = AsyncNameResolver.$(OBJEXT)
 @ENABLE_MESSAGE_DIGEST_TRUE@am__objects_8 = IteratableChunkChecksumValidator.$(OBJEXT) \
 @ENABLE_MESSAGE_DIGEST_TRUE@	IteratableChecksumValidator.$(OBJEXT) \
+@ENABLE_MESSAGE_DIGEST_TRUE@	CheckIntegrityDispatcherCommand.$(OBJEXT) \
 @ENABLE_MESSAGE_DIGEST_TRUE@	CheckIntegrityCommand.$(OBJEXT) \
 @ENABLE_MESSAGE_DIGEST_TRUE@	ChecksumCheckIntegrityEntry.$(OBJEXT) \
 @ENABLE_MESSAGE_DIGEST_TRUE@	messageDigest.$(OBJEXT) \
@@ -785,7 +788,7 @@ am__objects_22 = SocketCore.$(OBJEXT) Command.$(OBJEXT) \
 	DownloadHandlerFactory.$(OBJEXT) \
 	MemoryBufferPreDownloadHandler.$(OBJEXT) \
 	HaveEraseCommand.$(OBJEXT) Piece.$(OBJEXT) \
-	CheckIntegrityMan.$(OBJEXT) CheckIntegrityEntry.$(OBJEXT) \
+	CheckIntegrityEntry.$(OBJEXT) \
 	PieceHashCheckIntegrityEntry.$(OBJEXT) \
 	StreamCheckIntegrityEntry.$(OBJEXT) DiskAdaptor.$(OBJEXT) \
 	AbstractSingleDiskAdaptor.$(OBJEXT) CopyDiskAdaptor.$(OBJEXT) \
@@ -1102,17 +1105,16 @@ SRCS = Socket.h SocketCore.cc SocketCore.h BinaryStream.h Command.cc \
 	DownloadHandlerConstants.h DownloadHandlerFactory.cc \
 	DownloadHandlerFactory.h MemoryBufferPreDownloadHandler.cc \
 	MemoryBufferPreDownloadHandler.h HaveEraseCommand.cc \
-	HaveEraseCommand.h Piece.cc Piece.h CheckIntegrityMan.cc \
-	CheckIntegrityMan.h CheckIntegrityEntry.cc \
-	CheckIntegrityEntry.h PieceHashCheckIntegrityEntry.cc \
-	PieceHashCheckIntegrityEntry.h StreamCheckIntegrityEntry.cc \
-	StreamCheckIntegrityEntry.h IteratableValidator.h \
-	DiskAdaptor.cc DiskAdaptor.h AbstractSingleDiskAdaptor.cc \
-	AbstractSingleDiskAdaptor.h CopyDiskAdaptor.cc \
-	CopyDiskAdaptor.h DirectDiskAdaptor.cc DirectDiskAdaptor.h \
-	MultiDiskAdaptor.cc MultiDiskAdaptor.h Peer.cc \
-	PeerSessionResource.cc PeerSessionResource.h BtRegistry.cc \
-	BtRegistry.h MultiFileAllocationIterator.cc \
+	HaveEraseCommand.h Piece.cc Piece.h CheckIntegrityMan.h \
+	CheckIntegrityEntry.cc CheckIntegrityEntry.h \
+	PieceHashCheckIntegrityEntry.cc PieceHashCheckIntegrityEntry.h \
+	StreamCheckIntegrityEntry.cc StreamCheckIntegrityEntry.h \
+	IteratableValidator.h DiskAdaptor.cc DiskAdaptor.h \
+	AbstractSingleDiskAdaptor.cc AbstractSingleDiskAdaptor.h \
+	CopyDiskAdaptor.cc CopyDiskAdaptor.h DirectDiskAdaptor.cc \
+	DirectDiskAdaptor.h MultiDiskAdaptor.cc MultiDiskAdaptor.h \
+	Peer.cc PeerSessionResource.cc PeerSessionResource.h \
+	BtRegistry.cc BtRegistry.h MultiFileAllocationIterator.cc \
 	MultiFileAllocationIterator.h PeerConnection.cc \
 	PeerConnection.h ByteArrayDiskWriter.cc ByteArrayDiskWriter.h \
 	ByteArrayDiskWriterFactory.cc ByteArrayDiskWriterFactory.h \
@@ -1287,8 +1289,8 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ByteArrayDiskWriter.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ByteArrayDiskWriterFactory.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CheckIntegrityCommand.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CheckIntegrityDispatcherCommand.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CheckIntegrityEntry.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CheckIntegrityMan.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ChecksumCheckIntegrityEntry.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ChunkedDecoder.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Command.Po@am__quote@

+ 2 - 4
src/RequestGroup.cc

@@ -347,10 +347,8 @@ void RequestGroup::processCheckIntegrityEntry(std::deque<Command*>& commands,
   if(e->option->getAsBool(PREF_CHECK_INTEGRITY) &&
      entry->isValidationReady()) {
     entry->initValidator();
-    entry->cutTrailingGarbage();
-    CheckIntegrityCommand* command =
-      new CheckIntegrityCommand(e->newCUID(), this, e, entry);
-    commands.push_back(command);
+    entry->cutTrailingGarbage();    
+    e->_checkIntegrityMan->pushEntry(entry);
   } else
 #endif // ENABLE_MESSAGE_DIGEST
     {

+ 1 - 1
src/StatCalc.h

@@ -38,11 +38,11 @@
 #include "common.h"
 #include "SharedHandle.h"
 #include "FileAllocationMan.h"
+#include "CheckIntegrityMan.h"
 
 namespace aria2 {
 
 class RequestGroupMan;
-class CheckIntegrityMan;
 
 class StatCalc {
 public: