From 5699b675268658ea958f7c2306e19849dff9bc41 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 28 Jun 2009 10:37:15 +0000 Subject: [PATCH] 2009-06-28 Tatsuhiro Tsujikawa Rewritten DownloadContext and removed SingleFileDownloadContext and BtContext and its derived classes. BitTorrent specific attributes are now set by DownloadContext::setAttribute() with key bittorrent::BITTORRENT. * src/AbstractBtMessage.cc * src/AbstractBtMessage.h * src/AbstractCommand.cc * src/AbstractCommand.h * src/AbstractProxyRequestCommand.cc * src/AbstractProxyResponseCommand.cc * src/ActivePeerConnectionCommand.cc * src/ActivePeerConnectionCommand.h * src/AnnounceList.cc * src/BtCheckIntegrityEntry.cc * src/BtConstants.h * src/BtContext.h: Removed * src/BtDependency.cc * src/BtExtendedMessage.cc * src/BtPieceMessage.cc * src/BtPieceMessage.h * src/BtPostDownloadHandler.cc * src/BtRegistry.cc * src/BtRegistry.h * src/BtSetup.cc * src/CheckIntegrityCommand.cc * src/CheckIntegrityEntry.cc * src/ChecksumCheckIntegrityEntry.cc * src/ConsoleStatCalc.cc * src/ContentTypeRequestGroupCriteria.cc * src/DHTGetPeersCommand.cc * src/DHTGetPeersCommand.h * src/DHTPeerLookupTask.cc * src/DHTPeerLookupTask.h * src/DHTTaskFactory.h * src/DHTTaskFactoryImpl.cc * src/DHTTaskFactoryImpl.h * src/DefaultBtAnnounce.cc * src/DefaultBtAnnounce.h * src/DefaultBtContext.cc: Removed * src/DefaultBtContext.h: Removed * src/DefaultBtInteractive.cc * src/DefaultBtInteractive.h * src/DefaultBtMessageDispatcher.cc * src/DefaultBtMessageDispatcher.h * src/DefaultBtMessageFactory.cc * src/DefaultBtMessageFactory.h * src/DefaultBtMessageReceiver.cc * src/DefaultBtMessageReceiver.h * src/DefaultBtProgressInfoFile.cc * src/DefaultBtRequestFactory.cc * src/DefaultBtRequestFactory.h * src/DefaultExtensionMessageFactory.cc * src/DefaultExtensionMessageFactory.h * src/DefaultPeerStorage.cc * src/DefaultPeerStorage.h * src/DefaultPieceStorage.cc * src/DefaultSegmentManFactory.cc * src/DiskAdaptor.cc * src/DiskAdaptor.h * src/DownloadContext.cc * src/DownloadContext.h * src/DownloadEngine.cc * src/DownloadEngineFactory.cc * src/DownloadHandler.cc * src/DownloadResult.h * src/FileAllocationCommand.cc * src/FileAllocationDispatcherCommand.cc * src/FileAllocationEntry.cc * src/FileEntry.h * src/FillRequestGroupCommand.cc * src/FtpDownloadCommand.cc * src/FtpFinishDownloadCommand.cc * src/FtpInitiateConnectionCommand.cc * src/FtpNegotiationCommand.cc * src/FtpTunnelRequestCommand.cc * src/FtpTunnelResponseCommand.cc * src/HandshakeExtensionMessage.cc * src/HandshakeExtensionMessage.h * src/HaveEraseCommand.cc * src/HttpDownloadCommand.cc * src/HttpInitiateConnectionCommand.cc * src/HttpProxyRequestCommand.cc * src/HttpProxyResponseCommand.cc * src/HttpRequest.cc * src/HttpRequest.h * src/HttpRequestCommand.cc * src/HttpResponseCommand.cc * src/HttpServerBodyCommand.cc * src/HttpServerCommand.cc * src/HttpSkipResponseCommand.cc * src/InitiateConnectionCommandFactory.cc * src/InitiatorMSEHandshakeCommand.cc * src/InitiatorMSEHandshakeCommand.h * src/IteratableChecksumValidator.cc * src/IteratableChecksumValidator.h * src/IteratableChunkChecksumValidator.cc * src/MSEHandshake.cc * src/MSEHandshake.h * src/Makefile.am * src/Makefile.in * src/Metalink2RequestGroup.cc * src/MetalinkPostDownloadHandler.cc * src/MultiDiskAdaptor.cc * src/MultiDiskAdaptor.h * src/MultiFileAllocationIterator.cc * src/MultiUrlRequestInfo.cc * src/PeerChokeCommand.cc * src/PeerChokeCommand.h * src/PeerInitiateConnectionCommand.cc * src/PeerInitiateConnectionCommand.h * src/PeerInteractionCommand.cc * src/PeerInteractionCommand.h * src/PeerReceiveHandshakeCommand.cc * src/PieceHashCheckIntegrityEntry.cc * src/RealtimeCommand.cc * src/ReceiverMSEHandshakeCommand.cc * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupEntry.cc * src/RequestGroupMan.cc * src/SeedCheckCommand.cc * src/SeedCheckCommand.h * src/SegmentMan.cc * src/ShareRatioSeedCriteria.h * src/SingleFileDownloadContext.cc: Removed * src/SingleFileDownloadContext.h: Removed * src/SleepCommand.cc * src/StreamCheckIntegrityEntry.cc * src/TrackerWatcherCommand.cc * src/TrackerWatcherCommand.h * src/UnknownLengthPieceStorage.cc * src/Util.cc * src/Util.h * src/XmlRpcMethodImpl.cc * src/bittorrent_helper.cc * src/bittorrent_helper.h * src/download_helper.cc * src/main.cc * src/option_processing.cc * test/BitfieldManTest.cc * test/BittorrentHelperTest.cc * test/BtCancelMessageTest.cc * test/BtChokeMessageTest.cc * test/BtDependencyTest.cc * test/BtPieceMessageTest.cc * test/BtPostDownloadHandlerTest.cc * test/BtRegistryTest.cc * test/BtRejectMessageTest.cc * test/BtRequestMessageTest.cc * test/DHTPeerAnnounceStorageTest.cc * test/DefaultBtAnnounceTest.cc * test/DefaultBtContextTest.cc: Removed * test/DefaultBtMessageDispatcherTest.cc * test/DefaultBtMessageFactoryTest.cc * test/DefaultBtProgressInfoFileTest.cc * test/DefaultBtRequestFactoryTest.cc * test/DefaultExtensionMessageFactoryTest.cc * test/DefaultPeerStorageTest.cc * test/DefaultPieceStorageTest.cc * test/DirectDiskAdaptorTest.cc * test/DownloadContextTest.cc * test/DownloadHandlerFactoryTest.cc * test/DownloadHelperTest.cc * test/HandshakeExtensionMessageTest.cc * test/HttpRequestTest.cc * test/HttpResponseTest.cc * test/IteratableChecksumValidatorTest.cc * test/IteratableChunkChecksumValidatorTest.cc * test/MSEHandshakeTest.cc * test/Makefile.am * test/Makefile.in * test/Metalink2RequestGroupTest.cc * test/MetalinkPostDownloadHandlerTest.cc * test/MockBtContext.h: Removed * test/MockDHTTaskFactory.h * test/MockDownloadContext.h: Removed * test/MockPieceStorage.h * test/MultiDiskAdaptorTest.cc * test/MultiFileAllocationIteratorTest.cc * test/RequestGroupManTest.cc * test/RequestGroupTest.cc * test/SegmentManTest.cc * test/ShareRatioSeedCriteriaTest.cc * test/SingleFileDownloadContextTest.cc: Removed * test/UtilTest.cc * test/XmlRpcMethodTest.cc --- ChangeLog | 189 ++++++ src/AbstractBtMessage.cc | 6 - src/AbstractBtMessage.h | 10 - src/AbstractCommand.cc | 5 +- src/AbstractCommand.h | 7 +- src/AbstractProxyRequestCommand.cc | 1 + src/AbstractProxyResponseCommand.cc | 1 + src/ActivePeerConnectionCommand.cc | 6 +- src/ActivePeerConnectionCommand.h | 3 - src/AnnounceList.cc | 3 +- src/BtCheckIntegrityEntry.cc | 1 + src/BtConstants.h | 4 + src/BtContext.h | 97 --- src/BtDependency.cc | 49 +- src/BtExtendedMessage.cc | 1 - src/BtPieceMessage.cc | 21 +- src/BtPieceMessage.h | 4 + src/BtPostDownloadHandler.cc | 19 +- src/BtRegistry.cc | 8 +- src/BtRegistry.h | 18 +- src/BtSetup.cc | 28 +- src/CheckIntegrityCommand.cc | 7 +- src/CheckIntegrityEntry.cc | 1 + src/ChecksumCheckIntegrityEntry.cc | 15 +- src/ConsoleStatCalc.cc | 17 +- src/ContentTypeRequestGroupCriteria.cc | 16 +- src/DHTGetPeersCommand.cc | 13 +- src/DHTGetPeersCommand.h | 6 +- src/DHTPeerLookupTask.cc | 18 +- src/DHTPeerLookupTask.h | 6 +- src/DHTTaskFactory.h | 4 +- src/DHTTaskFactoryImpl.cc | 3 +- src/DHTTaskFactoryImpl.h | 2 +- src/DefaultBtAnnounce.cc | 18 +- src/DefaultBtAnnounce.h | 6 +- src/DefaultBtContext.cc | 577 ----------------- src/DefaultBtContext.h | 232 ------- src/DefaultBtInteractive.cc | 25 +- src/DefaultBtInteractive.h | 6 +- src/DefaultBtMessageDispatcher.cc | 9 +- src/DefaultBtMessageDispatcher.h | 6 +- src/DefaultBtMessageFactory.cc | 51 +- src/DefaultBtMessageFactory.h | 6 +- src/DefaultBtMessageReceiver.cc | 15 +- src/DefaultBtMessageReceiver.h | 6 +- src/DefaultBtProgressInfoFile.cc | 41 +- src/DefaultBtRequestFactory.cc | 6 - src/DefaultBtRequestFactory.h | 4 - src/DefaultExtensionMessageFactory.cc | 11 +- src/DefaultExtensionMessageFactory.h | 8 +- src/DefaultPeerStorage.cc | 5 +- src/DefaultPeerStorage.h | 5 +- src/DefaultPieceStorage.cc | 17 +- src/DefaultSegmentManFactory.cc | 5 +- src/DiskAdaptor.cc | 4 - src/DiskAdaptor.h | 12 +- src/DownloadContext.cc | 92 ++- src/DownloadContext.h | 190 ++++-- src/DownloadEngine.cc | 15 +- src/DownloadEngineFactory.cc | 1 + src/DownloadHandler.cc | 1 + src/DownloadResult.h | 6 +- src/FileAllocationCommand.cc | 4 +- src/FileAllocationDispatcherCommand.cc | 1 + src/FileAllocationEntry.cc | 1 + src/FileEntry.h | 8 + src/FillRequestGroupCommand.cc | 1 + src/FtpDownloadCommand.cc | 1 + src/FtpFinishDownloadCommand.cc | 1 + src/FtpInitiateConnectionCommand.cc | 1 + src/FtpNegotiationCommand.cc | 25 +- src/FtpTunnelRequestCommand.cc | 1 + src/FtpTunnelResponseCommand.cc | 1 + src/HandshakeExtensionMessage.cc | 6 - src/HandshakeExtensionMessage.h | 5 - src/HaveEraseCommand.cc | 1 + src/HttpDownloadCommand.cc | 1 + src/HttpInitiateConnectionCommand.cc | 1 + src/HttpProxyRequestCommand.cc | 1 + src/HttpProxyResponseCommand.cc | 1 + src/HttpRequest.cc | 15 +- src/HttpRequest.h | 14 +- src/HttpRequestCommand.cc | 2 +- src/HttpResponseCommand.cc | 32 +- src/HttpServerBodyCommand.cc | 1 + src/HttpServerCommand.cc | 1 + src/HttpSkipResponseCommand.cc | 1 + src/InitiateConnectionCommandFactory.cc | 1 + src/InitiatorMSEHandshakeCommand.cc | 22 +- src/InitiatorMSEHandshakeCommand.h | 17 +- src/IteratableChecksumValidator.cc | 7 +- src/IteratableChecksumValidator.h | 6 +- src/IteratableChunkChecksumValidator.cc | 4 +- src/MSEHandshake.cc | 24 +- src/MSEHandshake.h | 4 +- src/Makefile.am | 6 +- src/Makefile.in | 46 +- src/Metalink2RequestGroup.cc | 19 +- src/MetalinkPostDownloadHandler.cc | 2 +- src/MultiDiskAdaptor.cc | 27 +- src/MultiDiskAdaptor.h | 8 +- src/MultiFileAllocationIterator.cc | 6 +- src/MultiUrlRequestInfo.cc | 1 + src/PeerChokeCommand.cc | 7 +- src/PeerChokeCommand.h | 6 +- src/PeerInitiateConnectionCommand.cc | 10 +- src/PeerInitiateConnectionCommand.h | 4 - src/PeerInteractionCommand.cc | 35 +- src/PeerInteractionCommand.h | 4 - src/PeerReceiveHandshakeCommand.cc | 21 +- src/PieceHashCheckIntegrityEntry.cc | 6 +- src/RealtimeCommand.cc | 1 + src/ReceiverMSEHandshakeCommand.cc | 9 +- src/RequestGroup.cc | 168 +++-- src/RequestGroup.h | 7 +- src/RequestGroupEntry.cc | 1 + src/RequestGroupMan.cc | 8 +- src/SeedCheckCommand.cc | 4 +- src/SeedCheckCommand.h | 3 - src/SegmentMan.cc | 5 +- src/ShareRatioSeedCriteria.h | 11 +- src/SingleFileDownloadContext.cc | 108 ---- src/SingleFileDownloadContext.h | 180 ------ src/SleepCommand.cc | 1 + src/StreamCheckIntegrityEntry.cc | 1 + src/TrackerWatcherCommand.cc | 42 +- src/TrackerWatcherCommand.h | 6 +- src/UnknownLengthPieceStorage.cc | 8 +- src/Util.cc | 15 - src/Util.h | 18 +- src/XmlRpcMethodImpl.cc | 46 +- src/bittorrent_helper.cc | 529 ++++++++++++++++ src/bittorrent_helper.h | 132 ++++ src/download_helper.cc | 38 +- src/main.cc | 13 +- src/option_processing.cc | 6 + test/BitfieldManTest.cc | 74 ++- test/BittorrentHelperTest.cc | 632 +++++++++++++++++++ test/BtCancelMessageTest.cc | 5 - test/BtChokeMessageTest.cc | 8 +- test/BtDependencyTest.cc | 63 +- test/BtPieceMessageTest.cc | 15 +- test/BtPostDownloadHandlerTest.cc | 31 +- test/BtRegistryTest.cc | 43 +- test/BtRejectMessageTest.cc | 6 - test/BtRequestMessageTest.cc | 12 +- test/DHTPeerAnnounceStorageTest.cc | 46 +- test/DefaultBtAnnounceTest.cc | 134 ++-- test/DefaultBtContextTest.cc | 610 ------------------ test/DefaultBtMessageDispatcherTest.cc | 17 +- test/DefaultBtMessageFactoryTest.cc | 11 +- test/DefaultBtProgressInfoFileTest.cc | 91 +-- test/DefaultBtRequestFactoryTest.cc | 17 +- test/DefaultExtensionMessageFactoryTest.cc | 8 - test/DefaultPeerStorageTest.cc | 34 +- test/DefaultPieceStorageTest.cc | 54 +- test/DirectDiskAdaptorTest.cc | 9 +- test/DownloadContextTest.cc | 52 +- test/DownloadHandlerFactoryTest.cc | 26 +- test/DownloadHelperTest.cc | 20 +- test/HandshakeExtensionMessageTest.cc | 4 - test/HttpRequestTest.cc | 29 +- test/HttpResponseTest.cc | 8 +- test/IteratableChecksumValidatorTest.cc | 10 +- test/IteratableChunkChecksumValidatorTest.cc | 16 +- test/MSEHandshakeTest.cc | 23 +- test/Makefile.am | 8 +- test/Makefile.in | 32 +- test/Metalink2RequestGroupTest.cc | 25 +- test/MetalinkPostDownloadHandlerTest.cc | 23 +- test/MockBtContext.h | 178 ------ test/MockDHTTaskFactory.h | 2 +- test/MockDownloadContext.h | 67 -- test/MockPieceStorage.h | 3 +- test/MultiDiskAdaptorTest.cc | 92 ++- test/MultiFileAllocationIteratorTest.cc | 12 +- test/RequestGroupManTest.cc | 12 +- test/RequestGroupTest.cc | 20 +- test/SegmentManTest.cc | 18 +- test/ShareRatioSeedCriteriaTest.cc | 14 +- test/SingleFileDownloadContextTest.cc | 58 -- test/UtilTest.cc | 2 +- test/XmlRpcMethodTest.cc | 12 +- 183 files changed, 2986 insertions(+), 3449 deletions(-) delete mode 100644 src/BtContext.h delete mode 100644 src/DefaultBtContext.cc delete mode 100644 src/DefaultBtContext.h delete mode 100644 src/SingleFileDownloadContext.cc delete mode 100644 src/SingleFileDownloadContext.h create mode 100644 src/bittorrent_helper.cc create mode 100644 src/bittorrent_helper.h create mode 100644 test/BittorrentHelperTest.cc delete mode 100644 test/DefaultBtContextTest.cc delete mode 100644 test/MockBtContext.h delete mode 100644 test/MockDownloadContext.h delete mode 100644 test/SingleFileDownloadContextTest.cc diff --git a/ChangeLog b/ChangeLog index 708dd7e27..1c6039716 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,192 @@ +2009-06-28 Tatsuhiro Tsujikawa + + Rewritten DownloadContext and removed SingleFileDownloadContext + and BtContext and its derived classes. BitTorrent specific + attributes are now set by DownloadContext::setAttribute() with key + bittorrent::BITTORRENT. + * src/AbstractBtMessage.cc + * src/AbstractBtMessage.h + * src/AbstractCommand.cc + * src/AbstractCommand.h + * src/AbstractProxyRequestCommand.cc + * src/AbstractProxyResponseCommand.cc + * src/ActivePeerConnectionCommand.cc + * src/ActivePeerConnectionCommand.h + * src/AnnounceList.cc + * src/BtCheckIntegrityEntry.cc + * src/BtConstants.h + * src/BtContext.h: Removed + * src/BtDependency.cc + * src/BtExtendedMessage.cc + * src/BtPieceMessage.cc + * src/BtPieceMessage.h + * src/BtPostDownloadHandler.cc + * src/BtRegistry.cc + * src/BtRegistry.h + * src/BtSetup.cc + * src/CheckIntegrityCommand.cc + * src/CheckIntegrityEntry.cc + * src/ChecksumCheckIntegrityEntry.cc + * src/ConsoleStatCalc.cc + * src/ContentTypeRequestGroupCriteria.cc + * src/DHTGetPeersCommand.cc + * src/DHTGetPeersCommand.h + * src/DHTPeerLookupTask.cc + * src/DHTPeerLookupTask.h + * src/DHTTaskFactory.h + * src/DHTTaskFactoryImpl.cc + * src/DHTTaskFactoryImpl.h + * src/DefaultBtAnnounce.cc + * src/DefaultBtAnnounce.h + * src/DefaultBtContext.cc: Removed + * src/DefaultBtContext.h: Removed + * src/DefaultBtInteractive.cc + * src/DefaultBtInteractive.h + * src/DefaultBtMessageDispatcher.cc + * src/DefaultBtMessageDispatcher.h + * src/DefaultBtMessageFactory.cc + * src/DefaultBtMessageFactory.h + * src/DefaultBtMessageReceiver.cc + * src/DefaultBtMessageReceiver.h + * src/DefaultBtProgressInfoFile.cc + * src/DefaultBtRequestFactory.cc + * src/DefaultBtRequestFactory.h + * src/DefaultExtensionMessageFactory.cc + * src/DefaultExtensionMessageFactory.h + * src/DefaultPeerStorage.cc + * src/DefaultPeerStorage.h + * src/DefaultPieceStorage.cc + * src/DefaultSegmentManFactory.cc + * src/DiskAdaptor.cc + * src/DiskAdaptor.h + * src/DownloadContext.cc + * src/DownloadContext.h + * src/DownloadEngine.cc + * src/DownloadEngineFactory.cc + * src/DownloadHandler.cc + * src/DownloadResult.h + * src/FileAllocationCommand.cc + * src/FileAllocationDispatcherCommand.cc + * src/FileAllocationEntry.cc + * src/FileEntry.h + * src/FillRequestGroupCommand.cc + * src/FtpDownloadCommand.cc + * src/FtpFinishDownloadCommand.cc + * src/FtpInitiateConnectionCommand.cc + * src/FtpNegotiationCommand.cc + * src/FtpTunnelRequestCommand.cc + * src/FtpTunnelResponseCommand.cc + * src/HandshakeExtensionMessage.cc + * src/HandshakeExtensionMessage.h + * src/HaveEraseCommand.cc + * src/HttpDownloadCommand.cc + * src/HttpInitiateConnectionCommand.cc + * src/HttpProxyRequestCommand.cc + * src/HttpProxyResponseCommand.cc + * src/HttpRequest.cc + * src/HttpRequest.h + * src/HttpRequestCommand.cc + * src/HttpResponseCommand.cc + * src/HttpServerBodyCommand.cc + * src/HttpServerCommand.cc + * src/HttpSkipResponseCommand.cc + * src/InitiateConnectionCommandFactory.cc + * src/InitiatorMSEHandshakeCommand.cc + * src/InitiatorMSEHandshakeCommand.h + * src/IteratableChecksumValidator.cc + * src/IteratableChecksumValidator.h + * src/IteratableChunkChecksumValidator.cc + * src/MSEHandshake.cc + * src/MSEHandshake.h + * src/Makefile.am + * src/Makefile.in + * src/Metalink2RequestGroup.cc + * src/MetalinkPostDownloadHandler.cc + * src/MultiDiskAdaptor.cc + * src/MultiDiskAdaptor.h + * src/MultiFileAllocationIterator.cc + * src/MultiUrlRequestInfo.cc + * src/PeerChokeCommand.cc + * src/PeerChokeCommand.h + * src/PeerInitiateConnectionCommand.cc + * src/PeerInitiateConnectionCommand.h + * src/PeerInteractionCommand.cc + * src/PeerInteractionCommand.h + * src/PeerReceiveHandshakeCommand.cc + * src/PieceHashCheckIntegrityEntry.cc + * src/RealtimeCommand.cc + * src/ReceiverMSEHandshakeCommand.cc + * src/RequestGroup.cc + * src/RequestGroup.h + * src/RequestGroupEntry.cc + * src/RequestGroupMan.cc + * src/SeedCheckCommand.cc + * src/SeedCheckCommand.h + * src/SegmentMan.cc + * src/ShareRatioSeedCriteria.h + * src/SingleFileDownloadContext.cc: Removed + * src/SingleFileDownloadContext.h: Removed + * src/SleepCommand.cc + * src/StreamCheckIntegrityEntry.cc + * src/TrackerWatcherCommand.cc + * src/TrackerWatcherCommand.h + * src/UnknownLengthPieceStorage.cc + * src/Util.cc + * src/Util.h + * src/XmlRpcMethodImpl.cc + * src/bittorrent_helper.cc + * src/bittorrent_helper.h + * src/download_helper.cc + * src/main.cc + * src/option_processing.cc + * test/BitfieldManTest.cc + * test/BittorrentHelperTest.cc + * test/BtCancelMessageTest.cc + * test/BtChokeMessageTest.cc + * test/BtDependencyTest.cc + * test/BtPieceMessageTest.cc + * test/BtPostDownloadHandlerTest.cc + * test/BtRegistryTest.cc + * test/BtRejectMessageTest.cc + * test/BtRequestMessageTest.cc + * test/DHTPeerAnnounceStorageTest.cc + * test/DefaultBtAnnounceTest.cc + * test/DefaultBtContextTest.cc: Removed + * test/DefaultBtMessageDispatcherTest.cc + * test/DefaultBtMessageFactoryTest.cc + * test/DefaultBtProgressInfoFileTest.cc + * test/DefaultBtRequestFactoryTest.cc + * test/DefaultExtensionMessageFactoryTest.cc + * test/DefaultPeerStorageTest.cc + * test/DefaultPieceStorageTest.cc + * test/DirectDiskAdaptorTest.cc + * test/DownloadContextTest.cc + * test/DownloadHandlerFactoryTest.cc + * test/DownloadHelperTest.cc + * test/HandshakeExtensionMessageTest.cc + * test/HttpRequestTest.cc + * test/HttpResponseTest.cc + * test/IteratableChecksumValidatorTest.cc + * test/IteratableChunkChecksumValidatorTest.cc + * test/MSEHandshakeTest.cc + * test/Makefile.am + * test/Makefile.in + * test/Metalink2RequestGroupTest.cc + * test/MetalinkPostDownloadHandlerTest.cc + * test/MockBtContext.h: Removed + * test/MockDHTTaskFactory.h + * test/MockDownloadContext.h: Removed + * test/MockPieceStorage.h + * test/MultiDiskAdaptorTest.cc + * test/MultiFileAllocationIteratorTest.cc + * test/RequestGroupManTest.cc + * test/RequestGroupTest.cc + * test/SegmentManTest.cc + * test/ShareRatioSeedCriteriaTest.cc + * test/SingleFileDownloadContextTest.cc: Removed + * test/UtilTest.cc + * test/XmlRpcMethodTest.cc + 2009-06-24 Tatsuhiro Tsujikawa Added experimental support of WEB-Seeding for multi-file torrent. diff --git a/src/AbstractBtMessage.cc b/src/AbstractBtMessage.cc index f2aa432b7..d68d49b1f 100644 --- a/src/AbstractBtMessage.cc +++ b/src/AbstractBtMessage.cc @@ -34,7 +34,6 @@ /* copyright --> */ #include "AbstractBtMessage.h" #include "Peer.h" -#include "BtContext.h" #include "PieceStorage.h" #include "BtMessageValidator.h" #include "LogFactory.h" @@ -73,11 +72,6 @@ AbstractBtMessage::setBtMessageValidator(const SharedHandle& this->validator = validator; } -void AbstractBtMessage::setBtContext(const SharedHandle& btContext) -{ - this->btContext = btContext; -} - void AbstractBtMessage::setPieceStorage(const SharedHandle& pieceStorage) { this->pieceStorage = pieceStorage; diff --git a/src/AbstractBtMessage.h b/src/AbstractBtMessage.h index 16fa4013b..588bc96eb 100644 --- a/src/AbstractBtMessage.h +++ b/src/AbstractBtMessage.h @@ -41,7 +41,6 @@ namespace aria2 { -class BtContext; class PieceStorage; class Peer; class BtMessageDispatcher; @@ -60,8 +59,6 @@ protected: std::string _name; - SharedHandle btContext; - SharedHandle pieceStorage; SharedHandle peer; @@ -137,13 +134,6 @@ public: void setBtMessageValidator(const SharedHandle& validator); - void setBtContext(const SharedHandle& btContext); - - const SharedHandle& getBtContext() const - { - return btContext; - } - void setPieceStorage(const SharedHandle& pieceStorage); void setBtMessageDispatcher(const WeakHandle& dispatcher); diff --git a/src/AbstractCommand.cc b/src/AbstractCommand.cc index b1004a48b..57f1a80ad 100644 --- a/src/AbstractCommand.cc +++ b/src/AbstractCommand.cc @@ -36,7 +36,6 @@ #include -#include "RequestGroup.h" #include "Request.h" #include "DownloadEngine.h" #include "Option.h" @@ -231,9 +230,9 @@ bool AbstractCommand::execute() { void AbstractCommand::tryReserved() { _requestGroup->removeServerHost(cuid); - if(_requestGroup->getDownloadContext()->getFileMode() == DownloadContext::SINGLE) { + if(_requestGroup->getDownloadContext()->getFileEntries().size() == 1) { const SharedHandle& entry = - _requestGroup->getDownloadContext()->getFileEntries().front(); + _requestGroup->getDownloadContext()->getFirstFileEntry(); // Don't create new command if currently file length is unknown // and there are no URI left. Because file length is unknown, we // can assume that there are no in-flight request object. diff --git a/src/AbstractCommand.h b/src/AbstractCommand.h index ba7a7aa46..d7ced6d26 100644 --- a/src/AbstractCommand.h +++ b/src/AbstractCommand.h @@ -39,12 +39,12 @@ #include "SharedHandle.h" #include "TimeA2.h" #include "FileEntry.h" +#include "RequestGroup.h" namespace aria2 { class Request; class DownloadEngine; -class RequestGroup; class Segment; class Exception; class SocketCore; @@ -122,6 +122,11 @@ protected: const std::string& resolveProxyMethod(const std::string& protocol) const; const SharedHandle