aria2/src/RequestGroup.h

562 lines
13 KiB
C
Raw Normal View History

2007-05-20 13:57:56 +00:00
/* <!-- copyright */
/*
* aria2 - The high speed download utility
*
* Copyright (C) 2006 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
2007-05-20 13:57:56 +00:00
*
* 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_REQUEST_GROUP_H
#define D_REQUEST_GROUP_H
2007-05-20 13:57:56 +00:00
#include "common.h"
2008-11-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Made BtRegistry non-static object. Now DownloadEngine has a reference to its object. * src/AbstractBtMessage.cc * src/ActivePeerConnectionCommand.cc * src/ActivePeerConnectionCommand.h * src/BtContextAwareCommand.cc * src/BtContextAwareCommand.h * src/BtExtendedMessage.cc * src/BtExtendedMessage.h * src/BtInterestedMessage.cc * src/BtInterestedMessage.h * src/BtNotInterestedMessage.cc * src/BtNotInterestedMessage.h * src/BtRegistry.cc * src/BtRegistry.h * src/BtSeederStateChoke.cc * src/BtSetup.cc * src/DHTGetPeersCommand.cc * src/DHTGetPeersCommand.h * src/DHTPeerAnnounceEntry.cc * src/DHTPeerAnnounceEntry.h * src/DHTPeerAnnounceStorage.cc * src/DHTPeerAnnounceStorage.h * src/DHTPeerLookupTask.cc * src/DHTPeerLookupTask.h * src/DHTSetup.cc * src/DHTSetup.h * src/DHTTaskFactory.h * src/DHTTaskFactoryImpl.cc * src/DHTTaskFactoryImpl.h * src/DefaultBtAnnounce.cc * src/DefaultBtInteractive.cc * src/DefaultBtInteractive.h * src/DefaultBtMessageDispatcher.cc * src/DefaultBtMessageDispatcher.h * src/DefaultBtMessageFactory.cc * src/DefaultBtMessageFactory.h * src/DefaultBtMessageReceiver.cc * src/DefaultBtProgressInfoFile.cc * src/DefaultBtProgressInfoFile.h * src/DefaultBtRequestFactory.cc * src/DefaultBtRequestFactory.h * src/DefaultExtensionMessageFactory.cc * src/DefaultExtensionMessageFactory.h * src/DefaultPeerStorage.cc * src/DefaultPeerStorage.h * src/DownloadEngine.cc * src/DownloadEngine.h * src/InitiatorMSEHandshakeCommand.cc * src/InitiatorMSEHandshakeCommand.h * src/MSEHandshake.cc * src/MSEHandshake.h * src/Makefile.am * src/Makefile.in * src/PeerChokeCommand.cc * src/PeerChokeCommand.h * src/PeerInitiateConnectionCommand.cc * src/PeerInitiateConnectionCommand.h * src/PeerInteractionCommand.cc * src/PeerInteractionCommand.h * src/PeerObject.h * src/PeerReceiveHandshakeCommand.cc * src/PeerReceiveHandshakeCommand.h * src/ReceiverMSEHandshakeCommand.cc * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/RequestGroupMan.h * src/SeedCheckCommand.cc * src/SeedCheckCommand.h * src/ShareRatioSeedCriteria.h * src/SimpleBtMessage.cc * src/TrackerWatcherCommand.cc * src/TrackerWatcherCommand.h * src/UTPexExtensionMessage.cc * src/UTPexExtensionMessage.h * test/BtCancelMessageTest.cc * test/BtChokeMessageTest.cc * test/BtExtendedMessageTest.cc * test/BtInterestedMessageTest.cc * test/BtNotInterestedMessageTest.cc * test/BtPieceMessageTest.cc * test/BtPortMessageTest.cc * test/BtRegistryTest.cc * test/BtRejectMessageTest.cc * test/BtRequestMessageTest.cc * test/DHTPeerAnnounceEntryTest.cc * test/DHTPeerAnnounceStorageTest.cc * test/DefaultBtMessageDispatcherTest.cc * test/DefaultBtMessageFactoryTest.cc * test/DefaultBtProgressInfoFileTest.cc * test/DefaultBtRequestFactoryTest.cc * test/DefaultExtensionMessageFactoryTest.cc * test/MSEHandshakeTest.cc * test/MockDHTTaskFactory.h * test/ShareRatioSeedCriteriaTest.cc * test/UTPexExtensionMessageTest.cc
2008-11-03 06:49:02 +00:00
#include <string>
#include <algorithm>
#include <vector>
2008-11-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Made BtRegistry non-static object. Now DownloadEngine has a reference to its object. * src/AbstractBtMessage.cc * src/ActivePeerConnectionCommand.cc * src/ActivePeerConnectionCommand.h * src/BtContextAwareCommand.cc * src/BtContextAwareCommand.h * src/BtExtendedMessage.cc * src/BtExtendedMessage.h * src/BtInterestedMessage.cc * src/BtInterestedMessage.h * src/BtNotInterestedMessage.cc * src/BtNotInterestedMessage.h * src/BtRegistry.cc * src/BtRegistry.h * src/BtSeederStateChoke.cc * src/BtSetup.cc * src/DHTGetPeersCommand.cc * src/DHTGetPeersCommand.h * src/DHTPeerAnnounceEntry.cc * src/DHTPeerAnnounceEntry.h * src/DHTPeerAnnounceStorage.cc * src/DHTPeerAnnounceStorage.h * src/DHTPeerLookupTask.cc * src/DHTPeerLookupTask.h * src/DHTSetup.cc * src/DHTSetup.h * src/DHTTaskFactory.h * src/DHTTaskFactoryImpl.cc * src/DHTTaskFactoryImpl.h * src/DefaultBtAnnounce.cc * src/DefaultBtInteractive.cc * src/DefaultBtInteractive.h * src/DefaultBtMessageDispatcher.cc * src/DefaultBtMessageDispatcher.h * src/DefaultBtMessageFactory.cc * src/DefaultBtMessageFactory.h * src/DefaultBtMessageReceiver.cc * src/DefaultBtProgressInfoFile.cc * src/DefaultBtProgressInfoFile.h * src/DefaultBtRequestFactory.cc * src/DefaultBtRequestFactory.h * src/DefaultExtensionMessageFactory.cc * src/DefaultExtensionMessageFactory.h * src/DefaultPeerStorage.cc * src/DefaultPeerStorage.h * src/DownloadEngine.cc * src/DownloadEngine.h * src/InitiatorMSEHandshakeCommand.cc * src/InitiatorMSEHandshakeCommand.h * src/MSEHandshake.cc * src/MSEHandshake.h * src/Makefile.am * src/Makefile.in * src/PeerChokeCommand.cc * src/PeerChokeCommand.h * src/PeerInitiateConnectionCommand.cc * src/PeerInitiateConnectionCommand.h * src/PeerInteractionCommand.cc * src/PeerInteractionCommand.h * src/PeerObject.h * src/PeerReceiveHandshakeCommand.cc * src/PeerReceiveHandshakeCommand.h * src/ReceiverMSEHandshakeCommand.cc * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/RequestGroupMan.h * src/SeedCheckCommand.cc * src/SeedCheckCommand.h * src/ShareRatioSeedCriteria.h * src/SimpleBtMessage.cc * src/TrackerWatcherCommand.cc * src/TrackerWatcherCommand.h * src/UTPexExtensionMessage.cc * src/UTPexExtensionMessage.h * test/BtCancelMessageTest.cc * test/BtChokeMessageTest.cc * test/BtExtendedMessageTest.cc * test/BtInterestedMessageTest.cc * test/BtNotInterestedMessageTest.cc * test/BtPieceMessageTest.cc * test/BtPortMessageTest.cc * test/BtRegistryTest.cc * test/BtRejectMessageTest.cc * test/BtRequestMessageTest.cc * test/DHTPeerAnnounceEntryTest.cc * test/DHTPeerAnnounceStorageTest.cc * test/DefaultBtMessageDispatcherTest.cc * test/DefaultBtMessageFactoryTest.cc * test/DefaultBtProgressInfoFileTest.cc * test/DefaultBtRequestFactoryTest.cc * test/DefaultExtensionMessageFactoryTest.cc * test/MSEHandshakeTest.cc * test/MockDHTTaskFactory.h * test/ShareRatioSeedCriteriaTest.cc * test/UTPexExtensionMessageTest.cc
2008-11-03 06:49:02 +00:00
#include "SharedHandle.h"
#include "TransferStat.h"
#include "TimeA2.h"
#include "Request.h"
#include "error_code.h"
#include "MetadataInfo.h"
namespace aria2 {
2007-05-20 13:57:56 +00:00
class DownloadEngine;
class SegmentMan;
class Command;
class DownloadCommand;
class DownloadContext;
class PieceStorage;
class BtProgressInfoFile;
class Dependency;
2007-11-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Rewritten to add content-type support. * src/DownloadHandler.{h, cc} * src/BtPostDownloadHandler.{h, cc} * test/BtPostDownloadHandlerTest.cc * src/MetalinkPostDownloadHandler.{h, cc} * test/MetalinkPostDownloadHandlerTest.cc * src/PostDownloadHandler.{h, cc} * src/DownloadHandlerConstants.{h, cc} * src/RequestGroup.cc * src/HttpResponseCommand.cc * src/FtpNegotiationCommand.cc * src/SingleFileDownloadContext.{h, cc} * src/RequestGroup.h * src/RequestGroupCriteria.h * src/ContentTypeRequestGroupCriteria.h Added 'mem' option value for --follow-metalink, --follow-torrent. If it is give, metalink/torrent file is not written to the disk, but just is kept in memory. Parsing is occurred on memory. * src/MetalinkHelper.{h, cc} * src/MetalinkProcessor.h * src/Xml2MetalinkProcessor.{h, cc} * test/Xml2MetalinkProcessorTest.cc * src/DownloadHandlerFactory.{h, cc} * test/DownloadHandlerFactoryTest.cc * src/PreDownloadHandler.{h, cc} * src/OptionHandlerFactory.cc * src/DefaultBtContext.{h, cc} * test/DefaultBtContextTest.cc * src/version_usage.cc * src/Metalink2RequestGroup.{h, cc} * src/RequestGroup.{h, cc} * src/a2functional.h * test/a2functionalTest.cc * src/MemoryBufferPreDownloadHandler.{h, cc} * src/OptionHandlerImpl.h * src/prefs.h * src/Util.{h, cc} * test/UtilTest.cc Keep DownloadResult rather than RequestGroup after downloads to reduce memory usage. * src/RequestGroupMan.{h, cc} * src/DownloadEngine.cc * src/BtDependency.{h, cc}: Changed the type of dependee from WeakHandle to SharedHandle because WeakHandle could be null. * src/RequestGroup.{h, cc} * src/DownloadEngineFactory.cc * src/DownloadResult.h Set totalLength after download finished * src/UnknownLengthPieceStorage.{h, cc} Keep torrent file specified in metalink in memory. * src/Metalink2RequestGroup.cc * src/BtDependency.cc * src/TrueRequestGroupCriteria.h Fixed the bug: seekg is used where seekp should be used. * src/ByteArrayDiskWriter.cc * test/ByteArraydiskWriterTest.cc
2007-11-27 12:27:10 +00:00
class PreDownloadHandler;
class PostDownloadHandler;
class DiskWriterFactory;
class Option;
class RequestGroup;
2007-11-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Don't connect server before checking file integrity at startup, if filesize and output file path are known. * src/AbstractCommand.cc * src/StreamFileAllocationEntry.cc * src/Metalink2RequestGroup.cc * src/RequestGroup.{h, cc} * src/HttpResponseCommand.cc * src/FtpNegotiationCommand.cc Added DownloadFailureException. If it is thrown, RequestGroup should halt. * src/AbstractCommand.cc * src/DownloadFailureException.h * src/RequestGroup.cc Catch RecoverableException, instead of DlAbortEx. * src/RequestGroupMan.cc * src/FillRequestGroupCommand.cc * src/MetaFileUtil.cc * src/IteratableChunkChecksumValidator.cc Now first parameter of MSG_DOWNLOAD_ABORTED is gid(RequestGroup:: getGID()) * src/CheckIntegrityCommand.cc * src/message.h Print gid instead of idx. * src/RequestGroupMan.cc Removed exception throwers declaration. * src/DirectDiskAdaptor.{h, cc} * src/SocketCore.{h, cc} * src/MultiDiskAdaptor.{h, cc} * src/HttpConnection.{h, cc} * src/HttpResponse.{h, cc} * src/DiskAdaptor.{h, cc} * src/CopyDiskAdaptor.{h, cc} * src/MultiDiskAdaptor.{h, cc} * src/HttpHeaderProcessor.{h, cc} * src/AbstractSingleDiskAdaptor.{h, cc} * src/Util.{h, cc} * test/UtilTest.cc * src/DefaultDiskWriter.{h, cc} * src/FtpConnection.{h, cc} * src/AbstractDiskWriter.{h, cc} Removed duplicate code. * src/StreamCheckIntegrityEntry.cc Removed unnecessary include. * src/DiskWriter.h Included Exception.h * src/option_processing.cc Included 2 files and added doc * src/TrackerWatcherCommand.cc * src/SocketCore.cc (writeData): Fixed send error with GnuTLS.
2007-11-09 18:01:12 +00:00
class CheckIntegrityEntry;
struct DownloadResult;
class URISelector;
2009-06-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> Removed _uris from RequestGroup. All functions that refer to _uris were moved to FileEntry. Exit status code are now defined in DownloadResultCode.h. * src/AbstractCommand.cc * src/AdaptiveURISelector.cc * src/AdaptiveURISelector.h * src/AutoSaveCommand.cc * src/BtPostDownloadHandler.cc * src/CheckIntegrityDispatcherCommand.cc * src/CookieStorage.cc * src/DHTAutoSaveCommand.cc * src/DHTBucketRefreshCommand.cc * src/DHTEntryPointNameResolveCommand.cc * src/DHTInteractionCommand.cc * src/DHTPeerAnnounceCommand.cc * src/DHTTokenUpdateCommand.cc * src/DlAbortEx.h * src/DlRetryEx.h * src/DownloadCommand.cc * src/DownloadContext.h * src/DownloadFailureException.h * src/DownloadResult.h * src/DownloadResultCode.h * src/FeedbackURISelector.cc * src/FeedbackURISelector.h * src/FileEntry.cc * src/FileEntry.h * src/FtpNegotiationCommand.cc * src/HttpListenCommand.cc * src/HttpResponseCommand.cc * src/HttpServerResponseCommand.cc * src/HttpSkipResponseCommand.cc * src/InOrderURISelector.cc * src/InOrderURISelector.h * src/Makefile.am * src/Makefile.in * src/Metalink2RequestGroup.cc * src/MultiUrlRequestInfo.cc * src/MultiUrlRequestInfo.h * src/OptionHandlerFactory.cc * src/PeerListenCommand.cc * src/RecoverableException.h * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/RequestGroupMan.h * src/TimedHaltCommand.cc * src/TrackerWatcherCommand.cc * src/URIResult.cc * src/URIResult.h * src/URISelector.h * src/XmlRpcMethodImpl.cc * src/bittorrent_helper.cc * src/bittorrent_helper.h * src/download_helper.cc * src/main.cc * src/option_processing.cc * test/BtDependencyTest.cc * test/BtPostDownloadHandlerTest.cc * test/CookieStorageTest.cc * test/DefaultBtMessageDispatcherTest.cc * test/DownloadHandlerFactoryTest.cc * test/DownloadHelperTest.cc * test/FeedbackURISelectorTest.cc * test/FileEntryTest.cc * test/InOrderURISelectorTest.cc * test/Metalink2RequestGroupTest.cc * test/MetalinkPostDownloadHandlerTest.cc * test/RequestGroupManTest.cc * test/RequestGroupTest.cc * test/XmlRpcMethodTest.cc
2009-06-29 08:42:58 +00:00
class URIResult;
class RequestGroupMan;
2008-11-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Made BtRegistry non-static object. Now DownloadEngine has a reference to its object. * src/AbstractBtMessage.cc * src/ActivePeerConnectionCommand.cc * src/ActivePeerConnectionCommand.h * src/BtContextAwareCommand.cc * src/BtContextAwareCommand.h * src/BtExtendedMessage.cc * src/BtExtendedMessage.h * src/BtInterestedMessage.cc * src/BtInterestedMessage.h * src/BtNotInterestedMessage.cc * src/BtNotInterestedMessage.h * src/BtRegistry.cc * src/BtRegistry.h * src/BtSeederStateChoke.cc * src/BtSetup.cc * src/DHTGetPeersCommand.cc * src/DHTGetPeersCommand.h * src/DHTPeerAnnounceEntry.cc * src/DHTPeerAnnounceEntry.h * src/DHTPeerAnnounceStorage.cc * src/DHTPeerAnnounceStorage.h * src/DHTPeerLookupTask.cc * src/DHTPeerLookupTask.h * src/DHTSetup.cc * src/DHTSetup.h * src/DHTTaskFactory.h * src/DHTTaskFactoryImpl.cc * src/DHTTaskFactoryImpl.h * src/DefaultBtAnnounce.cc * src/DefaultBtInteractive.cc * src/DefaultBtInteractive.h * src/DefaultBtMessageDispatcher.cc * src/DefaultBtMessageDispatcher.h * src/DefaultBtMessageFactory.cc * src/DefaultBtMessageFactory.h * src/DefaultBtMessageReceiver.cc * src/DefaultBtProgressInfoFile.cc * src/DefaultBtProgressInfoFile.h * src/DefaultBtRequestFactory.cc * src/DefaultBtRequestFactory.h * src/DefaultExtensionMessageFactory.cc * src/DefaultExtensionMessageFactory.h * src/DefaultPeerStorage.cc * src/DefaultPeerStorage.h * src/DownloadEngine.cc * src/DownloadEngine.h * src/InitiatorMSEHandshakeCommand.cc * src/InitiatorMSEHandshakeCommand.h * src/MSEHandshake.cc * src/MSEHandshake.h * src/Makefile.am * src/Makefile.in * src/PeerChokeCommand.cc * src/PeerChokeCommand.h * src/PeerInitiateConnectionCommand.cc * src/PeerInitiateConnectionCommand.h * src/PeerInteractionCommand.cc * src/PeerInteractionCommand.h * src/PeerObject.h * src/PeerReceiveHandshakeCommand.cc * src/PeerReceiveHandshakeCommand.h * src/ReceiverMSEHandshakeCommand.cc * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/RequestGroupMan.h * src/SeedCheckCommand.cc * src/SeedCheckCommand.h * src/ShareRatioSeedCriteria.h * src/SimpleBtMessage.cc * src/TrackerWatcherCommand.cc * src/TrackerWatcherCommand.h * src/UTPexExtensionMessage.cc * src/UTPexExtensionMessage.h * test/BtCancelMessageTest.cc * test/BtChokeMessageTest.cc * test/BtExtendedMessageTest.cc * test/BtInterestedMessageTest.cc * test/BtNotInterestedMessageTest.cc * test/BtPieceMessageTest.cc * test/BtPortMessageTest.cc * test/BtRegistryTest.cc * test/BtRejectMessageTest.cc * test/BtRequestMessageTest.cc * test/DHTPeerAnnounceEntryTest.cc * test/DHTPeerAnnounceStorageTest.cc * test/DefaultBtMessageDispatcherTest.cc * test/DefaultBtMessageFactoryTest.cc * test/DefaultBtProgressInfoFileTest.cc * test/DefaultBtRequestFactoryTest.cc * test/DefaultExtensionMessageFactoryTest.cc * test/MSEHandshakeTest.cc * test/MockDHTTaskFactory.h * test/ShareRatioSeedCriteriaTest.cc * test/UTPexExtensionMessageTest.cc
2008-11-03 06:49:02 +00:00
#ifdef ENABLE_BITTORRENT
class BtRuntime;
class PeerStorage;
#endif // ENABLE_BITTORRENT
2007-05-20 13:57:56 +00:00
2011-12-02 12:36:11 +00:00
// To make %lld happy, we use long long int instead of int64_t.
typedef long long int a2_gid_t;
2007-05-20 13:57:56 +00:00
class RequestGroup {
public:
enum HaltReason {
NONE,
SHUTDOWN_SIGNAL,
USER_REQUEST
};
2007-05-20 13:57:56 +00:00
private:
static a2_gid_t gidCounter_;
a2_gid_t gid_;
SharedHandle<Option> option_;
2009-05-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> Now RequestGroup has its own copy of Option object. This will help to give custom option for each RequestGroup. addTorrentFile command now takes options. * src/AbstractCommand.cc * src/AbstractCommand.h * src/AbstractProxyRequestCommand.cc * src/ActivePeerConnectionCommand.cc * src/ActivePeerConnectionCommand.h * src/AdaptiveURISelector.cc * src/BtCheckIntegrityEntry.cc * src/BtDependency.cc * src/BtDependency.h * src/BtFileAllocationEntry.cc * src/BtPostDownloadHandler.cc * src/CheckIntegrityEntry.cc * src/DownloadCommand.cc * src/FtpDownloadCommand.cc * src/FtpFinishDownloadCommand.cc * src/FtpInitiateConnectionCommand.cc * src/FtpNegotiationCommand.cc * src/HttpInitiateConnectionCommand.cc * src/HttpRequestCommand.cc * src/HttpResponseCommand.cc * src/HttpSkipResponseCommand.cc * src/InitiateConnectionCommand.cc * src/InitiateConnectionCommandFactory.cc * src/InitiatorMSEHandshakeCommand.cc * src/InitiatorMSEHandshakeCommand.h * src/Metalink2RequestGroup.cc * src/Metalink2RequestGroup.h * src/MetalinkPostDownloadHandler.cc * src/MultiUrlRequestInfo.cc * src/MultiUrlRequestInfo.h * src/PeerAbstractCommand.cc * src/PeerInteractionCommand.cc * src/PeerInteractionCommand.h * src/PeerReceiveHandshakeCommand.cc * src/PeerReceiveHandshakeCommand.h * src/RequestGroup.cc * src/RequestGroup.h * src/TrackerWatcherCommand.cc * src/TrackerWatcherCommand.h * src/XmlRpcMethod.cc * src/XmlRpcMethod.h * src/XmlRpcMethodImpl.cc * src/download_helper.cc * src/download_helper.h * src/main.cc * test/BtDependencyTest.cc * test/BtPostDownloadHandlerTest.cc * test/DefaultBtMessageDispatcherTest.cc * test/DownloadHandlerFactoryTest.cc * test/DownloadHelperTest.cc * test/Metalink2RequestGroupTest.cc * test/MetalinkPostDownloadHandlerTest.cc * test/RequestGroupManTest.cc * test/RequestGroupTest.cc
2009-05-08 16:41:21 +00:00
int numConcurrentCommand_;
/**
* This is the number of connections used in streaming protocol(http/ftp)
*/
int numStreamConnection_;
int numStreamCommand_;
int numCommand_;
SharedHandle<SegmentMan> segmentMan_;
SharedHandle<DownloadContext> downloadContext_;
SharedHandle<PieceStorage> pieceStorage_;
bool saveControlFile_;
SharedHandle<BtProgressInfoFile> progressInfoFile_;
SharedHandle<DiskWriterFactory> diskWriterFactory_;
SharedHandle<Dependency> dependency_;
bool fileAllocationEnabled_;
bool preLocalFileCheckEnabled_;
bool haltRequested_;
bool forceHaltRequested_;
HaltReason haltReason_;
bool pauseRequested_;
std::vector<SharedHandle<PreDownloadHandler> > preDownloadHandlers_;
2007-11-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Rewritten to add content-type support. * src/DownloadHandler.{h, cc} * src/BtPostDownloadHandler.{h, cc} * test/BtPostDownloadHandlerTest.cc * src/MetalinkPostDownloadHandler.{h, cc} * test/MetalinkPostDownloadHandlerTest.cc * src/PostDownloadHandler.{h, cc} * src/DownloadHandlerConstants.{h, cc} * src/RequestGroup.cc * src/HttpResponseCommand.cc * src/FtpNegotiationCommand.cc * src/SingleFileDownloadContext.{h, cc} * src/RequestGroup.h * src/RequestGroupCriteria.h * src/ContentTypeRequestGroupCriteria.h Added 'mem' option value for --follow-metalink, --follow-torrent. If it is give, metalink/torrent file is not written to the disk, but just is kept in memory. Parsing is occurred on memory. * src/MetalinkHelper.{h, cc} * src/MetalinkProcessor.h * src/Xml2MetalinkProcessor.{h, cc} * test/Xml2MetalinkProcessorTest.cc * src/DownloadHandlerFactory.{h, cc} * test/DownloadHandlerFactoryTest.cc * src/PreDownloadHandler.{h, cc} * src/OptionHandlerFactory.cc * src/DefaultBtContext.{h, cc} * test/DefaultBtContextTest.cc * src/version_usage.cc * src/Metalink2RequestGroup.{h, cc} * src/RequestGroup.{h, cc} * src/a2functional.h * test/a2functionalTest.cc * src/MemoryBufferPreDownloadHandler.{h, cc} * src/OptionHandlerImpl.h * src/prefs.h * src/Util.{h, cc} * test/UtilTest.cc Keep DownloadResult rather than RequestGroup after downloads to reduce memory usage. * src/RequestGroupMan.{h, cc} * src/DownloadEngine.cc * src/BtDependency.{h, cc}: Changed the type of dependee from WeakHandle to SharedHandle because WeakHandle could be null. * src/RequestGroup.{h, cc} * src/DownloadEngineFactory.cc * src/DownloadResult.h Set totalLength after download finished * src/UnknownLengthPieceStorage.{h, cc} Keep torrent file specified in metalink in memory. * src/Metalink2RequestGroup.cc * src/BtDependency.cc * src/TrueRequestGroupCriteria.h Fixed the bug: seekg is used where seekp should be used. * src/ByteArrayDiskWriter.cc * test/ByteArraydiskWriterTest.cc
2007-11-27 12:27:10 +00:00
std::vector<SharedHandle<PostDownloadHandler> > postDownloadHandlers_;
std::vector<std::string> acceptTypes_;
SharedHandle<URISelector> uriSelector_;
Time lastModifiedTime_;
int fileNotFoundCount_;
// Timeout used for HTTP/FTP downloads.
time_t timeout_;
#ifdef ENABLE_BITTORRENT
BtRuntime* btRuntime_;
2008-11-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Made BtRegistry non-static object. Now DownloadEngine has a reference to its object. * src/AbstractBtMessage.cc * src/ActivePeerConnectionCommand.cc * src/ActivePeerConnectionCommand.h * src/BtContextAwareCommand.cc * src/BtContextAwareCommand.h * src/BtExtendedMessage.cc * src/BtExtendedMessage.h * src/BtInterestedMessage.cc * src/BtInterestedMessage.h * src/BtNotInterestedMessage.cc * src/BtNotInterestedMessage.h * src/BtRegistry.cc * src/BtRegistry.h * src/BtSeederStateChoke.cc * src/BtSetup.cc * src/DHTGetPeersCommand.cc * src/DHTGetPeersCommand.h * src/DHTPeerAnnounceEntry.cc * src/DHTPeerAnnounceEntry.h * src/DHTPeerAnnounceStorage.cc * src/DHTPeerAnnounceStorage.h * src/DHTPeerLookupTask.cc * src/DHTPeerLookupTask.h * src/DHTSetup.cc * src/DHTSetup.h * src/DHTTaskFactory.h * src/DHTTaskFactoryImpl.cc * src/DHTTaskFactoryImpl.h * src/DefaultBtAnnounce.cc * src/DefaultBtInteractive.cc * src/DefaultBtInteractive.h * src/DefaultBtMessageDispatcher.cc * src/DefaultBtMessageDispatcher.h * src/DefaultBtMessageFactory.cc * src/DefaultBtMessageFactory.h * src/DefaultBtMessageReceiver.cc * src/DefaultBtProgressInfoFile.cc * src/DefaultBtProgressInfoFile.h * src/DefaultBtRequestFactory.cc * src/DefaultBtRequestFactory.h * src/DefaultExtensionMessageFactory.cc * src/DefaultExtensionMessageFactory.h * src/DefaultPeerStorage.cc * src/DefaultPeerStorage.h * src/DownloadEngine.cc * src/DownloadEngine.h * src/InitiatorMSEHandshakeCommand.cc * src/InitiatorMSEHandshakeCommand.h * src/MSEHandshake.cc * src/MSEHandshake.h * src/Makefile.am * src/Makefile.in * src/PeerChokeCommand.cc * src/PeerChokeCommand.h * src/PeerInitiateConnectionCommand.cc * src/PeerInitiateConnectionCommand.h * src/PeerInteractionCommand.cc * src/PeerInteractionCommand.h * src/PeerObject.h * src/PeerReceiveHandshakeCommand.cc * src/PeerReceiveHandshakeCommand.h * src/ReceiverMSEHandshakeCommand.cc * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/RequestGroupMan.h * src/SeedCheckCommand.cc * src/SeedCheckCommand.h * src/ShareRatioSeedCriteria.h * src/SimpleBtMessage.cc * src/TrackerWatcherCommand.cc * src/TrackerWatcherCommand.h * src/UTPexExtensionMessage.cc * src/UTPexExtensionMessage.h * test/BtCancelMessageTest.cc * test/BtChokeMessageTest.cc * test/BtExtendedMessageTest.cc * test/BtInterestedMessageTest.cc * test/BtNotInterestedMessageTest.cc * test/BtPieceMessageTest.cc * test/BtPortMessageTest.cc * test/BtRegistryTest.cc * test/BtRejectMessageTest.cc * test/BtRequestMessageTest.cc * test/DHTPeerAnnounceEntryTest.cc * test/DHTPeerAnnounceStorageTest.cc * test/DefaultBtMessageDispatcherTest.cc * test/DefaultBtMessageFactoryTest.cc * test/DefaultBtProgressInfoFileTest.cc * test/DefaultBtRequestFactoryTest.cc * test/DefaultExtensionMessageFactoryTest.cc * test/MSEHandshakeTest.cc * test/MockDHTTaskFactory.h * test/ShareRatioSeedCriteriaTest.cc * test/UTPexExtensionMessageTest.cc
2008-11-03 06:49:02 +00:00
PeerStorage* peerStorage_;
#endif // ENABLE_BITTORRENT
2008-11-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Made BtRegistry non-static object. Now DownloadEngine has a reference to its object. * src/AbstractBtMessage.cc * src/ActivePeerConnectionCommand.cc * src/ActivePeerConnectionCommand.h * src/BtContextAwareCommand.cc * src/BtContextAwareCommand.h * src/BtExtendedMessage.cc * src/BtExtendedMessage.h * src/BtInterestedMessage.cc * src/BtInterestedMessage.h * src/BtNotInterestedMessage.cc * src/BtNotInterestedMessage.h * src/BtRegistry.cc * src/BtRegistry.h * src/BtSeederStateChoke.cc * src/BtSetup.cc * src/DHTGetPeersCommand.cc * src/DHTGetPeersCommand.h * src/DHTPeerAnnounceEntry.cc * src/DHTPeerAnnounceEntry.h * src/DHTPeerAnnounceStorage.cc * src/DHTPeerAnnounceStorage.h * src/DHTPeerLookupTask.cc * src/DHTPeerLookupTask.h * src/DHTSetup.cc * src/DHTSetup.h * src/DHTTaskFactory.h * src/DHTTaskFactoryImpl.cc * src/DHTTaskFactoryImpl.h * src/DefaultBtAnnounce.cc * src/DefaultBtInteractive.cc * src/DefaultBtInteractive.h * src/DefaultBtMessageDispatcher.cc * src/DefaultBtMessageDispatcher.h * src/DefaultBtMessageFactory.cc * src/DefaultBtMessageFactory.h * src/DefaultBtMessageReceiver.cc * src/DefaultBtProgressInfoFile.cc * src/DefaultBtProgressInfoFile.h * src/DefaultBtRequestFactory.cc * src/DefaultBtRequestFactory.h * src/DefaultExtensionMessageFactory.cc * src/DefaultExtensionMessageFactory.h * src/DefaultPeerStorage.cc * src/DefaultPeerStorage.h * src/DownloadEngine.cc * src/DownloadEngine.h * src/InitiatorMSEHandshakeCommand.cc * src/InitiatorMSEHandshakeCommand.h * src/MSEHandshake.cc * src/MSEHandshake.h * src/Makefile.am * src/Makefile.in * src/PeerChokeCommand.cc * src/PeerChokeCommand.h * src/PeerInitiateConnectionCommand.cc * src/PeerInitiateConnectionCommand.h * src/PeerInteractionCommand.cc * src/PeerInteractionCommand.h * src/PeerObject.h * src/PeerReceiveHandshakeCommand.cc * src/PeerReceiveHandshakeCommand.h * src/ReceiverMSEHandshakeCommand.cc * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/RequestGroupMan.h * src/SeedCheckCommand.cc * src/SeedCheckCommand.h * src/ShareRatioSeedCriteria.h * src/SimpleBtMessage.cc * src/TrackerWatcherCommand.cc * src/TrackerWatcherCommand.h * src/UTPexExtensionMessage.cc * src/UTPexExtensionMessage.h * test/BtCancelMessageTest.cc * test/BtChokeMessageTest.cc * test/BtExtendedMessageTest.cc * test/BtInterestedMessageTest.cc * test/BtNotInterestedMessageTest.cc * test/BtPieceMessageTest.cc * test/BtPortMessageTest.cc * test/BtRegistryTest.cc * test/BtRejectMessageTest.cc * test/BtRequestMessageTest.cc * test/DHTPeerAnnounceEntryTest.cc * test/DHTPeerAnnounceStorageTest.cc * test/DefaultBtMessageDispatcherTest.cc * test/DefaultBtMessageFactoryTest.cc * test/DefaultBtProgressInfoFileTest.cc * test/DefaultBtRequestFactoryTest.cc * test/DefaultExtensionMessageFactoryTest.cc * test/MSEHandshakeTest.cc * test/MockDHTTaskFactory.h * test/ShareRatioSeedCriteriaTest.cc * test/UTPexExtensionMessageTest.cc
2008-11-03 06:49:02 +00:00
// This flag just indicates that the downloaded file is not saved disk but
// just sits in memory.
bool inMemoryDownload_;
int maxDownloadSpeedLimit_;
int maxUploadSpeedLimit_;
error_code::Value lastErrorCode_;
2009-06-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> Removed _uris from RequestGroup. All functions that refer to _uris were moved to FileEntry. Exit status code are now defined in DownloadResultCode.h. * src/AbstractCommand.cc * src/AdaptiveURISelector.cc * src/AdaptiveURISelector.h * src/AutoSaveCommand.cc * src/BtPostDownloadHandler.cc * src/CheckIntegrityDispatcherCommand.cc * src/CookieStorage.cc * src/DHTAutoSaveCommand.cc * src/DHTBucketRefreshCommand.cc * src/DHTEntryPointNameResolveCommand.cc * src/DHTInteractionCommand.cc * src/DHTPeerAnnounceCommand.cc * src/DHTTokenUpdateCommand.cc * src/DlAbortEx.h * src/DlRetryEx.h * src/DownloadCommand.cc * src/DownloadContext.h * src/DownloadFailureException.h * src/DownloadResult.h * src/DownloadResultCode.h * src/FeedbackURISelector.cc * src/FeedbackURISelector.h * src/FileEntry.cc * src/FileEntry.h * src/FtpNegotiationCommand.cc * src/HttpListenCommand.cc * src/HttpResponseCommand.cc * src/HttpServerResponseCommand.cc * src/HttpSkipResponseCommand.cc * src/InOrderURISelector.cc * src/InOrderURISelector.h * src/Makefile.am * src/Makefile.in * src/Metalink2RequestGroup.cc * src/MultiUrlRequestInfo.cc * src/MultiUrlRequestInfo.h * src/OptionHandlerFactory.cc * src/PeerListenCommand.cc * src/RecoverableException.h * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/RequestGroupMan.h * src/TimedHaltCommand.cc * src/TrackerWatcherCommand.cc * src/URIResult.cc * src/URIResult.h * src/URISelector.h * src/XmlRpcMethodImpl.cc * src/bittorrent_helper.cc * src/bittorrent_helper.h * src/download_helper.cc * src/main.cc * src/option_processing.cc * test/BtDependencyTest.cc * test/BtPostDownloadHandlerTest.cc * test/CookieStorageTest.cc * test/DefaultBtMessageDispatcherTest.cc * test/DownloadHandlerFactoryTest.cc * test/DownloadHelperTest.cc * test/FeedbackURISelectorTest.cc * test/FileEntryTest.cc * test/InOrderURISelectorTest.cc * test/Metalink2RequestGroupTest.cc * test/MetalinkPostDownloadHandlerTest.cc * test/RequestGroupManTest.cc * test/RequestGroupTest.cc * test/XmlRpcMethodTest.cc
2009-06-29 08:42:58 +00:00
// If this download generates another downloads when completed(for
// example, downloads generated by PostDownloadHandler), this field
// has the GID of generated RequestGroups. empty list means there is
// no such RequestGroup.
std::vector<a2_gid_t> followedByGIDs_;
// If this download is a part of another download(for example,
// downloading torrent file described in Metalink file), this field
// has the GID of parent RequestGroup. 0 means this is a parent
// RequestGroup.
a2_gid_t belongsToGID_;
SharedHandle<MetadataInfo> metadataInfo_;
RequestGroupMan* requestGroupMan_;
int resumeFailureCount_;
void validateFilename(const std::string& expectedFilename,
const std::string& actualFilename) const;
2007-05-20 13:57:56 +00:00
2007-11-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Rewritten to add content-type support. * src/DownloadHandler.{h, cc} * src/BtPostDownloadHandler.{h, cc} * test/BtPostDownloadHandlerTest.cc * src/MetalinkPostDownloadHandler.{h, cc} * test/MetalinkPostDownloadHandlerTest.cc * src/PostDownloadHandler.{h, cc} * src/DownloadHandlerConstants.{h, cc} * src/RequestGroup.cc * src/HttpResponseCommand.cc * src/FtpNegotiationCommand.cc * src/SingleFileDownloadContext.{h, cc} * src/RequestGroup.h * src/RequestGroupCriteria.h * src/ContentTypeRequestGroupCriteria.h Added 'mem' option value for --follow-metalink, --follow-torrent. If it is give, metalink/torrent file is not written to the disk, but just is kept in memory. Parsing is occurred on memory. * src/MetalinkHelper.{h, cc} * src/MetalinkProcessor.h * src/Xml2MetalinkProcessor.{h, cc} * test/Xml2MetalinkProcessorTest.cc * src/DownloadHandlerFactory.{h, cc} * test/DownloadHandlerFactoryTest.cc * src/PreDownloadHandler.{h, cc} * src/OptionHandlerFactory.cc * src/DefaultBtContext.{h, cc} * test/DefaultBtContextTest.cc * src/version_usage.cc * src/Metalink2RequestGroup.{h, cc} * src/RequestGroup.{h, cc} * src/a2functional.h * test/a2functionalTest.cc * src/MemoryBufferPreDownloadHandler.{h, cc} * src/OptionHandlerImpl.h * src/prefs.h * src/Util.{h, cc} * test/UtilTest.cc Keep DownloadResult rather than RequestGroup after downloads to reduce memory usage. * src/RequestGroupMan.{h, cc} * src/DownloadEngine.cc * src/BtDependency.{h, cc}: Changed the type of dependee from WeakHandle to SharedHandle because WeakHandle could be null. * src/RequestGroup.{h, cc} * src/DownloadEngineFactory.cc * src/DownloadResult.h Set totalLength after download finished * src/UnknownLengthPieceStorage.{h, cc} Keep torrent file specified in metalink in memory. * src/Metalink2RequestGroup.cc * src/BtDependency.cc * src/TrueRequestGroupCriteria.h Fixed the bug: seekg is used where seekp should be used. * src/ByteArrayDiskWriter.cc * test/ByteArraydiskWriterTest.cc
2007-11-27 12:27:10 +00:00
void initializePreDownloadHandler();
void initializePostDownloadHandler();
2007-11-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Don't connect server before checking file integrity at startup, if filesize and output file path are known. * src/AbstractCommand.cc * src/StreamFileAllocationEntry.cc * src/Metalink2RequestGroup.cc * src/RequestGroup.{h, cc} * src/HttpResponseCommand.cc * src/FtpNegotiationCommand.cc Added DownloadFailureException. If it is thrown, RequestGroup should halt. * src/AbstractCommand.cc * src/DownloadFailureException.h * src/RequestGroup.cc Catch RecoverableException, instead of DlAbortEx. * src/RequestGroupMan.cc * src/FillRequestGroupCommand.cc * src/MetaFileUtil.cc * src/IteratableChunkChecksumValidator.cc Now first parameter of MSG_DOWNLOAD_ABORTED is gid(RequestGroup:: getGID()) * src/CheckIntegrityCommand.cc * src/message.h Print gid instead of idx. * src/RequestGroupMan.cc Removed exception throwers declaration. * src/DirectDiskAdaptor.{h, cc} * src/SocketCore.{h, cc} * src/MultiDiskAdaptor.{h, cc} * src/HttpConnection.{h, cc} * src/HttpResponse.{h, cc} * src/DiskAdaptor.{h, cc} * src/CopyDiskAdaptor.{h, cc} * src/MultiDiskAdaptor.{h, cc} * src/HttpHeaderProcessor.{h, cc} * src/AbstractSingleDiskAdaptor.{h, cc} * src/Util.{h, cc} * test/UtilTest.cc * src/DefaultDiskWriter.{h, cc} * src/FtpConnection.{h, cc} * src/AbstractDiskWriter.{h, cc} Removed duplicate code. * src/StreamCheckIntegrityEntry.cc Removed unnecessary include. * src/DiskWriter.h Included Exception.h * src/option_processing.cc Included 2 files and added doc * src/TrackerWatcherCommand.cc * src/SocketCore.cc (writeData): Fixed send error with GnuTLS.
2007-11-09 18:01:12 +00:00
bool tryAutoFileRenaming();
2009-06-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> Removed _uris from RequestGroup. All functions that refer to _uris were moved to FileEntry. Exit status code are now defined in DownloadResultCode.h. * src/AbstractCommand.cc * src/AdaptiveURISelector.cc * src/AdaptiveURISelector.h * src/AutoSaveCommand.cc * src/BtPostDownloadHandler.cc * src/CheckIntegrityDispatcherCommand.cc * src/CookieStorage.cc * src/DHTAutoSaveCommand.cc * src/DHTBucketRefreshCommand.cc * src/DHTEntryPointNameResolveCommand.cc * src/DHTInteractionCommand.cc * src/DHTPeerAnnounceCommand.cc * src/DHTTokenUpdateCommand.cc * src/DlAbortEx.h * src/DlRetryEx.h * src/DownloadCommand.cc * src/DownloadContext.h * src/DownloadFailureException.h * src/DownloadResult.h * src/DownloadResultCode.h * src/FeedbackURISelector.cc * src/FeedbackURISelector.h * src/FileEntry.cc * src/FileEntry.h * src/FtpNegotiationCommand.cc * src/HttpListenCommand.cc * src/HttpResponseCommand.cc * src/HttpServerResponseCommand.cc * src/HttpSkipResponseCommand.cc * src/InOrderURISelector.cc * src/InOrderURISelector.h * src/Makefile.am * src/Makefile.in * src/Metalink2RequestGroup.cc * src/MultiUrlRequestInfo.cc * src/MultiUrlRequestInfo.h * src/OptionHandlerFactory.cc * src/PeerListenCommand.cc * src/RecoverableException.h * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/RequestGroupMan.h * src/TimedHaltCommand.cc * src/TrackerWatcherCommand.cc * src/URIResult.cc * src/URIResult.h * src/URISelector.h * src/XmlRpcMethodImpl.cc * src/bittorrent_helper.cc * src/bittorrent_helper.h * src/download_helper.cc * src/main.cc * src/option_processing.cc * test/BtDependencyTest.cc * test/BtPostDownloadHandlerTest.cc * test/CookieStorageTest.cc * test/DefaultBtMessageDispatcherTest.cc * test/DownloadHandlerFactoryTest.cc * test/DownloadHelperTest.cc * test/FeedbackURISelectorTest.cc * test/FileEntryTest.cc * test/InOrderURISelectorTest.cc * test/Metalink2RequestGroupTest.cc * test/MetalinkPostDownloadHandlerTest.cc * test/RequestGroupManTest.cc * test/RequestGroupTest.cc * test/XmlRpcMethodTest.cc
2009-06-29 08:42:58 +00:00
// Returns the result code of this RequestGroup. If the download
// finished, then returns error_code::FINISHED. If the
2009-06-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> Removed _uris from RequestGroup. All functions that refer to _uris were moved to FileEntry. Exit status code are now defined in DownloadResultCode.h. * src/AbstractCommand.cc * src/AdaptiveURISelector.cc * src/AdaptiveURISelector.h * src/AutoSaveCommand.cc * src/BtPostDownloadHandler.cc * src/CheckIntegrityDispatcherCommand.cc * src/CookieStorage.cc * src/DHTAutoSaveCommand.cc * src/DHTBucketRefreshCommand.cc * src/DHTEntryPointNameResolveCommand.cc * src/DHTInteractionCommand.cc * src/DHTPeerAnnounceCommand.cc * src/DHTTokenUpdateCommand.cc * src/DlAbortEx.h * src/DlRetryEx.h * src/DownloadCommand.cc * src/DownloadContext.h * src/DownloadFailureException.h * src/DownloadResult.h * src/DownloadResultCode.h * src/FeedbackURISelector.cc * src/FeedbackURISelector.h * src/FileEntry.cc * src/FileEntry.h * src/FtpNegotiationCommand.cc * src/HttpListenCommand.cc * src/HttpResponseCommand.cc * src/HttpServerResponseCommand.cc * src/HttpSkipResponseCommand.cc * src/InOrderURISelector.cc * src/InOrderURISelector.h * src/Makefile.am * src/Makefile.in * src/Metalink2RequestGroup.cc * src/MultiUrlRequestInfo.cc * src/MultiUrlRequestInfo.h * src/OptionHandlerFactory.cc * src/PeerListenCommand.cc * src/RecoverableException.h * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/RequestGroupMan.h * src/TimedHaltCommand.cc * src/TrackerWatcherCommand.cc * src/URIResult.cc * src/URIResult.h * src/URISelector.h * src/XmlRpcMethodImpl.cc * src/bittorrent_helper.cc * src/bittorrent_helper.h * src/download_helper.cc * src/main.cc * src/option_processing.cc * test/BtDependencyTest.cc * test/BtPostDownloadHandlerTest.cc * test/CookieStorageTest.cc * test/DefaultBtMessageDispatcherTest.cc * test/DownloadHandlerFactoryTest.cc * test/DownloadHelperTest.cc * test/FeedbackURISelectorTest.cc * test/FileEntryTest.cc * test/InOrderURISelectorTest.cc * test/Metalink2RequestGroupTest.cc * test/MetalinkPostDownloadHandlerTest.cc * test/RequestGroupManTest.cc * test/RequestGroupTest.cc * test/XmlRpcMethodTest.cc
2009-06-29 08:42:58 +00:00
// download didn't finish and error result is available in
// _uriResults, then last result code is returned. Otherwise
// returns error_code::UNKNOWN_ERROR.
error_code::Value downloadResult() const;
void removeDefunctControlFile
(const SharedHandle<BtProgressInfoFile>& progressInfoFile);
2007-05-20 13:57:56 +00:00
public:
2009-06-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> Removed _uris from RequestGroup. All functions that refer to _uris were moved to FileEntry. Exit status code are now defined in DownloadResultCode.h. * src/AbstractCommand.cc * src/AdaptiveURISelector.cc * src/AdaptiveURISelector.h * src/AutoSaveCommand.cc * src/BtPostDownloadHandler.cc * src/CheckIntegrityDispatcherCommand.cc * src/CookieStorage.cc * src/DHTAutoSaveCommand.cc * src/DHTBucketRefreshCommand.cc * src/DHTEntryPointNameResolveCommand.cc * src/DHTInteractionCommand.cc * src/DHTPeerAnnounceCommand.cc * src/DHTTokenUpdateCommand.cc * src/DlAbortEx.h * src/DlRetryEx.h * src/DownloadCommand.cc * src/DownloadContext.h * src/DownloadFailureException.h * src/DownloadResult.h * src/DownloadResultCode.h * src/FeedbackURISelector.cc * src/FeedbackURISelector.h * src/FileEntry.cc * src/FileEntry.h * src/FtpNegotiationCommand.cc * src/HttpListenCommand.cc * src/HttpResponseCommand.cc * src/HttpServerResponseCommand.cc * src/HttpSkipResponseCommand.cc * src/InOrderURISelector.cc * src/InOrderURISelector.h * src/Makefile.am * src/Makefile.in * src/Metalink2RequestGroup.cc * src/MultiUrlRequestInfo.cc * src/MultiUrlRequestInfo.h * src/OptionHandlerFactory.cc * src/PeerListenCommand.cc * src/RecoverableException.h * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/RequestGroupMan.h * src/TimedHaltCommand.cc * src/TrackerWatcherCommand.cc * src/URIResult.cc * src/URIResult.h * src/URISelector.h * src/XmlRpcMethodImpl.cc * src/bittorrent_helper.cc * src/bittorrent_helper.h * src/download_helper.cc * src/main.cc * src/option_processing.cc * test/BtDependencyTest.cc * test/BtPostDownloadHandlerTest.cc * test/CookieStorageTest.cc * test/DefaultBtMessageDispatcherTest.cc * test/DownloadHandlerFactoryTest.cc * test/DownloadHelperTest.cc * test/FeedbackURISelectorTest.cc * test/FileEntryTest.cc * test/InOrderURISelectorTest.cc * test/Metalink2RequestGroupTest.cc * test/MetalinkPostDownloadHandlerTest.cc * test/RequestGroupManTest.cc * test/RequestGroupTest.cc * test/XmlRpcMethodTest.cc
2009-06-29 08:42:58 +00:00
RequestGroup(const SharedHandle<Option>& option);
2007-05-20 13:57:56 +00:00
~RequestGroup();
2007-05-20 13:57:56 +00:00
bool isCheckIntegrityReady();
2009-05-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> Implemented getter methods in header files to give them more chance of optimization. Return const reference for SharadHandle if possible. * src/AbstractAuthResolver.cc * src/AbstractAuthResolver.h * src/AbstractBtMessage.cc * src/AbstractBtMessage.h * src/AbstractSingleDiskAdaptor.cc * src/AbstractSingleDiskAdaptor.h * src/AsyncNameResolver.cc * src/AsyncNameResolver.h * src/BNode.cc * src/BNode.h * src/BitfieldMan.cc * src/BitfieldMan.h * src/BtAbortOutstandingRequestEvent.h * src/BtExtendedMessage.cc * src/BtExtendedMessage.h * src/BtSeederStateChoke.cc * src/BtSeederStateChoke.h * src/Cookie.cc * src/Cookie.h * src/DHTBucket.cc * src/DHTBucket.h * src/DHTConnectionImpl.cc * src/DHTConnectionImpl.h * src/DHTFindNodeReplyMessage.cc * src/DHTFindNodeReplyMessage.h * src/DHTGetPeersReplyMessage.cc * src/DHTGetPeersReplyMessage.h * src/DHTInteractionCommand.cc * src/DHTMessage.cc * src/DHTMessage.h * src/DHTMessageDispatcherImpl.cc * src/DHTMessageEntry.cc * src/DHTMessageReceiver.cc * src/DHTMessageReceiver.h * src/DHTMessageTrackerEntry.cc * src/DHTMessageTrackerEntry.h * src/DHTPeerAnnounceEntry.cc * src/DHTPeerAnnounceEntry.h * src/DHTPeerLookupTask.cc * src/DHTPeerLookupTask.h * src/DHTRoutingTableDeserializer.cc * src/DHTRoutingTableDeserializer.h * src/DefaultBtAnnounce.cc * src/DefaultBtAnnounce.h * src/DefaultBtMessageDispatcher.cc * src/DefaultBtMessageDispatcher.h * src/DefaultBtRequestFactory.cc * src/DefaultBtRequestFactory.h * src/DiskAdaptor.cc * src/DiskAdaptor.h * src/DownloadContext.cc * src/DownloadContext.h * src/DownloadEngine.cc * src/DownloadEngine.h * src/EpollEventPoll.cc * src/EpollEventPoll.h * src/FtpConnection.cc * src/FtpConnection.h * src/HttpConnection.cc * src/HttpConnection.h * src/HttpHeader.cc * src/HttpHeader.h * src/HttpRequest.cc * src/HttpRequest.h * src/HttpResponse.cc * src/HttpResponse.h * src/LibsslTLSContext.cc * src/LibsslTLSContext.h * src/MSEHandshake.cc * src/MSEHandshake.h * src/MetalinkEntry.cc * src/MetalinkEntry.h * src/MetalinkParserController.cc * src/MetalinkParserController.h * src/MetalinkParserStateMachine.cc * src/MetalinkParserStateMachine.h * src/MultiDiskAdaptor.cc * src/MultiDiskAdaptor.h * src/NetrcAuthResolver.cc * src/NetrcAuthResolver.h * src/Peer.cc * src/Peer.h * src/PeerSessionResource.cc * src/PeerSessionResource.h * src/Piece.cc * src/Piece.h * src/PieceStatMan.cc * src/PieceStatMan.h * src/Request.cc * src/Request.h * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/RequestGroupMan.h * src/RequestSlot.cc * src/RequestSlot.h * src/SegmentMan.cc * src/SegmentMan.h * src/SelectEventPoll.cc * src/SelectEventPoll.h * src/ServerStat.cc * src/ServerStat.h * src/Signature.cc * src/Signature.h * src/URIResult.cc * src/URIResult.h * src/UTPexExtensionMessage.cc * src/UTPexExtensionMessage.h
2009-05-29 12:12:22 +00:00
const SharedHandle<SegmentMan>& getSegmentMan() const
{
return segmentMan_;
2009-05-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> Implemented getter methods in header files to give them more chance of optimization. Return const reference for SharadHandle if possible. * src/AbstractAuthResolver.cc * src/AbstractAuthResolver.h * src/AbstractBtMessage.cc * src/AbstractBtMessage.h * src/AbstractSingleDiskAdaptor.cc * src/AbstractSingleDiskAdaptor.h * src/AsyncNameResolver.cc * src/AsyncNameResolver.h * src/BNode.cc * src/BNode.h * src/BitfieldMan.cc * src/BitfieldMan.h * src/BtAbortOutstandingRequestEvent.h * src/BtExtendedMessage.cc * src/BtExtendedMessage.h * src/BtSeederStateChoke.cc * src/BtSeederStateChoke.h * src/Cookie.cc * src/Cookie.h * src/DHTBucket.cc * src/DHTBucket.h * src/DHTConnectionImpl.cc * src/DHTConnectionImpl.h * src/DHTFindNodeReplyMessage.cc * src/DHTFindNodeReplyMessage.h * src/DHTGetPeersReplyMessage.cc * src/DHTGetPeersReplyMessage.h * src/DHTInteractionCommand.cc * src/DHTMessage.cc * src/DHTMessage.h * src/DHTMessageDispatcherImpl.cc * src/DHTMessageEntry.cc * src/DHTMessageReceiver.cc * src/DHTMessageReceiver.h * src/DHTMessageTrackerEntry.cc * src/DHTMessageTrackerEntry.h * src/DHTPeerAnnounceEntry.cc * src/DHTPeerAnnounceEntry.h * src/DHTPeerLookupTask.cc * src/DHTPeerLookupTask.h * src/DHTRoutingTableDeserializer.cc * src/DHTRoutingTableDeserializer.h * src/DefaultBtAnnounce.cc * src/DefaultBtAnnounce.h * src/DefaultBtMessageDispatcher.cc * src/DefaultBtMessageDispatcher.h * src/DefaultBtRequestFactory.cc * src/DefaultBtRequestFactory.h * src/DiskAdaptor.cc * src/DiskAdaptor.h * src/DownloadContext.cc * src/DownloadContext.h * src/DownloadEngine.cc * src/DownloadEngine.h * src/EpollEventPoll.cc * src/EpollEventPoll.h * src/FtpConnection.cc * src/FtpConnection.h * src/HttpConnection.cc * src/HttpConnection.h * src/HttpHeader.cc * src/HttpHeader.h * src/HttpRequest.cc * src/HttpRequest.h * src/HttpResponse.cc * src/HttpResponse.h * src/LibsslTLSContext.cc * src/LibsslTLSContext.h * src/MSEHandshake.cc * src/MSEHandshake.h * src/MetalinkEntry.cc * src/MetalinkEntry.h * src/MetalinkParserController.cc * src/MetalinkParserController.h * src/MetalinkParserStateMachine.cc * src/MetalinkParserStateMachine.h * src/MultiDiskAdaptor.cc * src/MultiDiskAdaptor.h * src/NetrcAuthResolver.cc * src/NetrcAuthResolver.h * src/Peer.cc * src/Peer.h * src/PeerSessionResource.cc * src/PeerSessionResource.h * src/Piece.cc * src/Piece.h * src/PieceStatMan.cc * src/PieceStatMan.h * src/Request.cc * src/Request.h * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/RequestGroupMan.h * src/RequestSlot.cc * src/RequestSlot.h * src/SegmentMan.cc * src/SegmentMan.h * src/SelectEventPoll.cc * src/SelectEventPoll.h * src/ServerStat.cc * src/ServerStat.h * src/Signature.cc * src/Signature.h * src/URIResult.cc * src/URIResult.h * src/UTPexExtensionMessage.cc * src/UTPexExtensionMessage.h
2009-05-29 12:12:22 +00:00
}
SharedHandle<CheckIntegrityEntry> createCheckIntegrityEntry();
// Returns first bootstrap commands to initiate a download.
// If this is HTTP/FTP download and file size is unknown, only 1 command
// (usually, HttpInitiateConnection or FtpInitiateConnection) will be created.
void createInitialCommand(std::vector<Command*>& commands,
DownloadEngine* e);
2007-05-20 13:57:56 +00:00
void createNextCommandWithAdj(std::vector<Command*>& commands,
DownloadEngine* e, int numAdj);
void createNextCommand(std::vector<Command*>& commands,
DownloadEngine* e, int numCommand);
2007-05-20 13:57:56 +00:00
void createNextCommand(std::vector<Command*>& commands, DownloadEngine* e);
bool downloadFinished() const;
2007-05-20 13:57:56 +00:00
bool allDownloadFinished() const;
void closeFile();
2007-05-20 13:57:56 +00:00
2009-06-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> 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-28 10:37:15 +00:00
std::string getFirstFilePath() const;
2007-05-20 13:57:56 +00:00
off_t getTotalLength() const;
2007-05-20 13:57:56 +00:00
off_t getCompletedLength() const;
2007-05-20 13:57:56 +00:00
/**
* Compares expected filename with specified actualFilename.
* The expected filename refers to FileEntry::getBasename() of the first
* element of DownloadContext::getFileEntries()
2007-05-20 13:57:56 +00:00
*/
void validateFilename(const std::string& actualFilename) const;
2007-05-20 13:57:56 +00:00
void validateTotalLength(off_t expectedTotalLength,
off_t actualTotalLength) const;
2009-06-24 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> Added experimental support of WEB-Seeding for multi-file torrent. Due to fundamental changes in file handling in HTTP/FTP code, many functions are not working: PeerStat, ServerHost, proxy..etc * src/AbstractCommand.cc * src/AbstractCommand.h * src/BitfieldMan.cc * src/BitfieldMan.h * src/CreateRequestCommand.cc * src/CreateRequestCommand.h * src/DefaultPieceStorage.cc * src/DefaultPieceStorage.h * src/DownloadCommand.cc * src/DownloadCommand.h * src/DownloadContext.cc * src/DownloadContext.h * src/FileEntry.cc * src/FileEntry.h * src/FtpDownloadCommand.cc * src/FtpDownloadCommand.h * src/FtpFinishDownloadCommand.cc * src/FtpFinishDownloadCommand.h * src/FtpInitiateConnectionCommand.cc * src/FtpInitiateConnectionCommand.h * src/FtpNegotiationCommand.cc * src/FtpNegotiationCommand.h * src/FtpTunnelResponseCommand.cc * src/HttpDownloadCommand.cc * src/HttpDownloadCommand.h * src/HttpInitiateConnectionCommand.cc * src/HttpInitiateConnectionCommand.h * src/HttpProxyResponseCommand.cc * src/HttpRequest.cc * src/HttpRequest.h * src/HttpRequestCommand.cc * src/HttpRequestCommand.h * src/HttpResponseCommand.cc * src/HttpResponseCommand.h * src/HttpSkipResponseCommand.cc * src/HttpSkipResponseCommand.h * src/InitiateConnectionCommand.cc * src/InitiateConnectionCommand.h * src/InitiateConnectionCommandFactory.cc * src/InitiateConnectionCommandFactory.h * src/Makefile.am * src/PieceStorage.h * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/SegmentMan.cc * src/SegmentMan.h * src/SingleFileDownloadContext.h * src/StreamFileAllocationEntry.cc * src/TrackerWatcherCommand.cc * src/UnknownLengthPieceStorage.cc * src/UnknownLengthPieceStorage.h * src/array_fun.h * src/bitfield.h * src/download_helper.cc * test/DownloadContextTest.cc * test/Makefile.am * test/MockDownloadContext.h
2009-06-23 15:35:45 +00:00
void validateTotalLength(off_t actualTotalLength) const;
2007-05-20 13:57:56 +00:00
void setNumConcurrentCommand(int num)
{
numConcurrentCommand_ = num;
}
int getNumConcurrentCommand() const
2009-05-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> Implemented getter methods in header files to give them more chance of optimization. Return const reference for SharadHandle if possible. * src/AbstractAuthResolver.cc * src/AbstractAuthResolver.h * src/AbstractBtMessage.cc * src/AbstractBtMessage.h * src/AbstractSingleDiskAdaptor.cc * src/AbstractSingleDiskAdaptor.h * src/AsyncNameResolver.cc * src/AsyncNameResolver.h * src/BNode.cc * src/BNode.h * src/BitfieldMan.cc * src/BitfieldMan.h * src/BtAbortOutstandingRequestEvent.h * src/BtExtendedMessage.cc * src/BtExtendedMessage.h * src/BtSeederStateChoke.cc * src/BtSeederStateChoke.h * src/Cookie.cc * src/Cookie.h * src/DHTBucket.cc * src/DHTBucket.h * src/DHTConnectionImpl.cc * src/DHTConnectionImpl.h * src/DHTFindNodeReplyMessage.cc * src/DHTFindNodeReplyMessage.h * src/DHTGetPeersReplyMessage.cc * src/DHTGetPeersReplyMessage.h * src/DHTInteractionCommand.cc * src/DHTMessage.cc * src/DHTMessage.h * src/DHTMessageDispatcherImpl.cc * src/DHTMessageEntry.cc * src/DHTMessageReceiver.cc * src/DHTMessageReceiver.h * src/DHTMessageTrackerEntry.cc * src/DHTMessageTrackerEntry.h * src/DHTPeerAnnounceEntry.cc * src/DHTPeerAnnounceEntry.h * src/DHTPeerLookupTask.cc * src/DHTPeerLookupTask.h * src/DHTRoutingTableDeserializer.cc * src/DHTRoutingTableDeserializer.h * src/DefaultBtAnnounce.cc * src/DefaultBtAnnounce.h * src/DefaultBtMessageDispatcher.cc * src/DefaultBtMessageDispatcher.h * src/DefaultBtRequestFactory.cc * src/DefaultBtRequestFactory.h * src/DiskAdaptor.cc * src/DiskAdaptor.h * src/DownloadContext.cc * src/DownloadContext.h * src/DownloadEngine.cc * src/DownloadEngine.h * src/EpollEventPoll.cc * src/EpollEventPoll.h * src/FtpConnection.cc * src/FtpConnection.h * src/HttpConnection.cc * src/HttpConnection.h * src/HttpHeader.cc * src/HttpHeader.h * src/HttpRequest.cc * src/HttpRequest.h * src/HttpResponse.cc * src/HttpResponse.h * src/LibsslTLSContext.cc * src/LibsslTLSContext.h * src/MSEHandshake.cc * src/MSEHandshake.h * src/MetalinkEntry.cc * src/MetalinkEntry.h * src/MetalinkParserController.cc * src/MetalinkParserController.h * src/MetalinkParserStateMachine.cc * src/MetalinkParserStateMachine.h * src/MultiDiskAdaptor.cc * src/MultiDiskAdaptor.h * src/NetrcAuthResolver.cc * src/NetrcAuthResolver.h * src/Peer.cc * src/Peer.h * src/PeerSessionResource.cc * src/PeerSessionResource.h * src/Piece.cc * src/Piece.h * src/PieceStatMan.cc * src/PieceStatMan.h * src/Request.cc * src/Request.h * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/RequestGroupMan.h * src/RequestSlot.cc * src/RequestSlot.h * src/SegmentMan.cc * src/SegmentMan.h * src/SelectEventPoll.cc * src/SelectEventPoll.h * src/ServerStat.cc * src/ServerStat.h * src/Signature.cc * src/Signature.h * src/URIResult.cc * src/URIResult.h * src/UTPexExtensionMessage.cc * src/UTPexExtensionMessage.h
2009-05-29 12:12:22 +00:00
{
return numConcurrentCommand_;
2009-05-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> Implemented getter methods in header files to give them more chance of optimization. Return const reference for SharadHandle if possible. * src/AbstractAuthResolver.cc * src/AbstractAuthResolver.h * src/AbstractBtMessage.cc * src/AbstractBtMessage.h * src/AbstractSingleDiskAdaptor.cc * src/AbstractSingleDiskAdaptor.h * src/AsyncNameResolver.cc * src/AsyncNameResolver.h * src/BNode.cc * src/BNode.h * src/BitfieldMan.cc * src/BitfieldMan.h * src/BtAbortOutstandingRequestEvent.h * src/BtExtendedMessage.cc * src/BtExtendedMessage.h * src/BtSeederStateChoke.cc * src/BtSeederStateChoke.h * src/Cookie.cc * src/Cookie.h * src/DHTBucket.cc * src/DHTBucket.h * src/DHTConnectionImpl.cc * src/DHTConnectionImpl.h * src/DHTFindNodeReplyMessage.cc * src/DHTFindNodeReplyMessage.h * src/DHTGetPeersReplyMessage.cc * src/DHTGetPeersReplyMessage.h * src/DHTInteractionCommand.cc * src/DHTMessage.cc * src/DHTMessage.h * src/DHTMessageDispatcherImpl.cc * src/DHTMessageEntry.cc * src/DHTMessageReceiver.cc * src/DHTMessageReceiver.h * src/DHTMessageTrackerEntry.cc * src/DHTMessageTrackerEntry.h * src/DHTPeerAnnounceEntry.cc * src/DHTPeerAnnounceEntry.h * src/DHTPeerLookupTask.cc * src/DHTPeerLookupTask.h * src/DHTRoutingTableDeserializer.cc * src/DHTRoutingTableDeserializer.h * src/DefaultBtAnnounce.cc * src/DefaultBtAnnounce.h * src/DefaultBtMessageDispatcher.cc * src/DefaultBtMessageDispatcher.h * src/DefaultBtRequestFactory.cc * src/DefaultBtRequestFactory.h * src/DiskAdaptor.cc * src/DiskAdaptor.h * src/DownloadContext.cc * src/DownloadContext.h * src/DownloadEngine.cc * src/DownloadEngine.h * src/EpollEventPoll.cc * src/EpollEventPoll.h * src/FtpConnection.cc * src/FtpConnection.h * src/HttpConnection.cc * src/HttpConnection.h * src/HttpHeader.cc * src/HttpHeader.h * src/HttpRequest.cc * src/HttpRequest.h * src/HttpResponse.cc * src/HttpResponse.h * src/LibsslTLSContext.cc * src/LibsslTLSContext.h * src/MSEHandshake.cc * src/MSEHandshake.h * src/MetalinkEntry.cc * src/MetalinkEntry.h * src/MetalinkParserController.cc * src/MetalinkParserController.h * src/MetalinkParserStateMachine.cc * src/MetalinkParserStateMachine.h * src/MultiDiskAdaptor.cc * src/MultiDiskAdaptor.h * src/NetrcAuthResolver.cc * src/NetrcAuthResolver.h * src/Peer.cc * src/Peer.h * src/PeerSessionResource.cc * src/PeerSessionResource.h * src/Piece.cc * src/Piece.h * src/PieceStatMan.cc * src/PieceStatMan.h * src/Request.cc * src/Request.h * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/RequestGroupMan.h * src/RequestSlot.cc * src/RequestSlot.h * src/SegmentMan.cc * src/SegmentMan.h * src/SelectEventPoll.cc * src/SelectEventPoll.h * src/ServerStat.cc * src/ServerStat.h * src/Signature.cc * src/Signature.h * src/URIResult.cc * src/URIResult.h * src/UTPexExtensionMessage.cc * src/UTPexExtensionMessage.h
2009-05-29 12:12:22 +00:00
}
a2_gid_t getGID() const
{
return gid_;
}
TransferStat calculateStat() const;
2009-05-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> Implemented getter methods in header files to give them more chance of optimization. Return const reference for SharadHandle if possible. * src/AbstractAuthResolver.cc * src/AbstractAuthResolver.h * src/AbstractBtMessage.cc * src/AbstractBtMessage.h * src/AbstractSingleDiskAdaptor.cc * src/AbstractSingleDiskAdaptor.h * src/AsyncNameResolver.cc * src/AsyncNameResolver.h * src/BNode.cc * src/BNode.h * src/BitfieldMan.cc * src/BitfieldMan.h * src/BtAbortOutstandingRequestEvent.h * src/BtExtendedMessage.cc * src/BtExtendedMessage.h * src/BtSeederStateChoke.cc * src/BtSeederStateChoke.h * src/Cookie.cc * src/Cookie.h * src/DHTBucket.cc * src/DHTBucket.h * src/DHTConnectionImpl.cc * src/DHTConnectionImpl.h * src/DHTFindNodeReplyMessage.cc * src/DHTFindNodeReplyMessage.h * src/DHTGetPeersReplyMessage.cc * src/DHTGetPeersReplyMessage.h * src/DHTInteractionCommand.cc * src/DHTMessage.cc * src/DHTMessage.h * src/DHTMessageDispatcherImpl.cc * src/DHTMessageEntry.cc * src/DHTMessageReceiver.cc * src/DHTMessageReceiver.h * src/DHTMessageTrackerEntry.cc * src/DHTMessageTrackerEntry.h * src/DHTPeerAnnounceEntry.cc * src/DHTPeerAnnounceEntry.h * src/DHTPeerLookupTask.cc * src/DHTPeerLookupTask.h * src/DHTRoutingTableDeserializer.cc * src/DHTRoutingTableDeserializer.h * src/DefaultBtAnnounce.cc * src/DefaultBtAnnounce.h * src/DefaultBtMessageDispatcher.cc * src/DefaultBtMessageDispatcher.h * src/DefaultBtRequestFactory.cc * src/DefaultBtRequestFactory.h * src/DiskAdaptor.cc * src/DiskAdaptor.h * src/DownloadContext.cc * src/DownloadContext.h * src/DownloadEngine.cc * src/DownloadEngine.h * src/EpollEventPoll.cc * src/EpollEventPoll.h * src/FtpConnection.cc * src/FtpConnection.h * src/HttpConnection.cc * src/HttpConnection.h * src/HttpHeader.cc * src/HttpHeader.h * src/HttpRequest.cc * src/HttpRequest.h * src/HttpResponse.cc * src/HttpResponse.h * src/LibsslTLSContext.cc * src/LibsslTLSContext.h * src/MSEHandshake.cc * src/MSEHandshake.h * src/MetalinkEntry.cc * src/MetalinkEntry.h * src/MetalinkParserController.cc * src/MetalinkParserController.h * src/MetalinkParserStateMachine.cc * src/MetalinkParserStateMachine.h * src/MultiDiskAdaptor.cc * src/MultiDiskAdaptor.h * src/NetrcAuthResolver.cc * src/NetrcAuthResolver.h * src/Peer.cc * src/Peer.h * src/PeerSessionResource.cc * src/PeerSessionResource.h * src/Piece.cc * src/Piece.h * src/PieceStatMan.cc * src/PieceStatMan.h * src/Request.cc * src/Request.h * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/RequestGroupMan.h * src/RequestSlot.cc * src/RequestSlot.h * src/SegmentMan.cc * src/SegmentMan.h * src/SelectEventPoll.cc * src/SelectEventPoll.h * src/ServerStat.cc * src/ServerStat.h * src/Signature.cc * src/Signature.h * src/URIResult.cc * src/URIResult.h * src/UTPexExtensionMessage.cc * src/UTPexExtensionMessage.h
2009-05-29 12:12:22 +00:00
const SharedHandle<DownloadContext>& getDownloadContext() const
{
return downloadContext_;
2009-05-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> Implemented getter methods in header files to give them more chance of optimization. Return const reference for SharadHandle if possible. * src/AbstractAuthResolver.cc * src/AbstractAuthResolver.h * src/AbstractBtMessage.cc * src/AbstractBtMessage.h * src/AbstractSingleDiskAdaptor.cc * src/AbstractSingleDiskAdaptor.h * src/AsyncNameResolver.cc * src/AsyncNameResolver.h * src/BNode.cc * src/BNode.h * src/BitfieldMan.cc * src/BitfieldMan.h * src/BtAbortOutstandingRequestEvent.h * src/BtExtendedMessage.cc * src/BtExtendedMessage.h * src/BtSeederStateChoke.cc * src/BtSeederStateChoke.h * src/Cookie.cc * src/Cookie.h * src/DHTBucket.cc * src/DHTBucket.h * src/DHTConnectionImpl.cc * src/DHTConnectionImpl.h * src/DHTFindNodeReplyMessage.cc * src/DHTFindNodeReplyMessage.h * src/DHTGetPeersReplyMessage.cc * src/DHTGetPeersReplyMessage.h * src/DHTInteractionCommand.cc * src/DHTMessage.cc * src/DHTMessage.h * src/DHTMessageDispatcherImpl.cc * src/DHTMessageEntry.cc * src/DHTMessageReceiver.cc * src/DHTMessageReceiver.h * src/DHTMessageTrackerEntry.cc * src/DHTMessageTrackerEntry.h * src/DHTPeerAnnounceEntry.cc * src/DHTPeerAnnounceEntry.h * src/DHTPeerLookupTask.cc * src/DHTPeerLookupTask.h * src/DHTRoutingTableDeserializer.cc * src/DHTRoutingTableDeserializer.h * src/DefaultBtAnnounce.cc * src/DefaultBtAnnounce.h * src/DefaultBtMessageDispatcher.cc * src/DefaultBtMessageDispatcher.h * src/DefaultBtRequestFactory.cc * src/DefaultBtRequestFactory.h * src/DiskAdaptor.cc * src/DiskAdaptor.h * src/DownloadContext.cc * src/DownloadContext.h * src/DownloadEngine.cc * src/DownloadEngine.h * src/EpollEventPoll.cc * src/EpollEventPoll.h * src/FtpConnection.cc * src/FtpConnection.h * src/HttpConnection.cc * src/HttpConnection.h * src/HttpHeader.cc * src/HttpHeader.h * src/HttpRequest.cc * src/HttpRequest.h * src/HttpResponse.cc * src/HttpResponse.h * src/LibsslTLSContext.cc * src/LibsslTLSContext.h * src/MSEHandshake.cc * src/MSEHandshake.h * src/MetalinkEntry.cc * src/MetalinkEntry.h * src/MetalinkParserController.cc * src/MetalinkParserController.h * src/MetalinkParserStateMachine.cc * src/MetalinkParserStateMachine.h * src/MultiDiskAdaptor.cc * src/MultiDiskAdaptor.h * src/NetrcAuthResolver.cc * src/NetrcAuthResolver.h * src/Peer.cc * src/Peer.h * src/PeerSessionResource.cc * src/PeerSessionResource.h * src/Piece.cc * src/Piece.h * src/PieceStatMan.cc * src/PieceStatMan.h * src/Request.cc * src/Request.h * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/RequestGroupMan.h * src/RequestSlot.cc * src/RequestSlot.h * src/SegmentMan.cc * src/SegmentMan.h * src/SelectEventPoll.cc * src/SelectEventPoll.h * src/ServerStat.cc * src/ServerStat.h * src/Signature.cc * src/Signature.h * src/URIResult.cc * src/URIResult.h * src/UTPexExtensionMessage.cc * src/UTPexExtensionMessage.h
2009-05-29 12:12:22 +00:00
}
// This function also calls
// downloadContext->setOwnerRequestGroup(this).
void setDownloadContext(const SharedHandle<DownloadContext>& downloadContext);
2009-05-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> Implemented getter methods in header files to give them more chance of optimization. Return const reference for SharadHandle if possible. * src/AbstractAuthResolver.cc * src/AbstractAuthResolver.h * src/AbstractBtMessage.cc * src/AbstractBtMessage.h * src/AbstractSingleDiskAdaptor.cc * src/AbstractSingleDiskAdaptor.h * src/AsyncNameResolver.cc * src/AsyncNameResolver.h * src/BNode.cc * src/BNode.h * src/BitfieldMan.cc * src/BitfieldMan.h * src/BtAbortOutstandingRequestEvent.h * src/BtExtendedMessage.cc * src/BtExtendedMessage.h * src/BtSeederStateChoke.cc * src/BtSeederStateChoke.h * src/Cookie.cc * src/Cookie.h * src/DHTBucket.cc * src/DHTBucket.h * src/DHTConnectionImpl.cc * src/DHTConnectionImpl.h * src/DHTFindNodeReplyMessage.cc * src/DHTFindNodeReplyMessage.h * src/DHTGetPeersReplyMessage.cc * src/DHTGetPeersReplyMessage.h * src/DHTInteractionCommand.cc * src/DHTMessage.cc * src/DHTMessage.h * src/DHTMessageDispatcherImpl.cc * src/DHTMessageEntry.cc * src/DHTMessageReceiver.cc * src/DHTMessageReceiver.h * src/DHTMessageTrackerEntry.cc * src/DHTMessageTrackerEntry.h * src/DHTPeerAnnounceEntry.cc * src/DHTPeerAnnounceEntry.h * src/DHTPeerLookupTask.cc * src/DHTPeerLookupTask.h * src/DHTRoutingTableDeserializer.cc * src/DHTRoutingTableDeserializer.h * src/DefaultBtAnnounce.cc * src/DefaultBtAnnounce.h * src/DefaultBtMessageDispatcher.cc * src/DefaultBtMessageDispatcher.h * src/DefaultBtRequestFactory.cc * src/DefaultBtRequestFactory.h * src/DiskAdaptor.cc * src/DiskAdaptor.h * src/DownloadContext.cc * src/DownloadContext.h * src/DownloadEngine.cc * src/DownloadEngine.h * src/EpollEventPoll.cc * src/EpollEventPoll.h * src/FtpConnection.cc * src/FtpConnection.h * src/HttpConnection.cc * src/HttpConnection.h * src/HttpHeader.cc * src/HttpHeader.h * src/HttpRequest.cc * src/HttpRequest.h * src/HttpResponse.cc * src/HttpResponse.h * src/LibsslTLSContext.cc * src/LibsslTLSContext.h * src/MSEHandshake.cc * src/MSEHandshake.h * src/MetalinkEntry.cc * src/MetalinkEntry.h * src/MetalinkParserController.cc * src/MetalinkParserController.h * src/MetalinkParserStateMachine.cc * src/MetalinkParserStateMachine.h * src/MultiDiskAdaptor.cc * src/MultiDiskAdaptor.h * src/NetrcAuthResolver.cc * src/NetrcAuthResolver.h * src/Peer.cc * src/Peer.h * src/PeerSessionResource.cc * src/PeerSessionResource.h * src/Piece.cc * src/Piece.h * src/PieceStatMan.cc * src/PieceStatMan.h * src/Request.cc * src/Request.h * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/RequestGroupMan.h * src/RequestSlot.cc * src/RequestSlot.h * src/SegmentMan.cc * src/SegmentMan.h * src/SelectEventPoll.cc * src/SelectEventPoll.h * src/ServerStat.cc * src/ServerStat.h * src/Signature.cc * src/Signature.h * src/URIResult.cc * src/URIResult.h * src/UTPexExtensionMessage.cc * src/UTPexExtensionMessage.h
2009-05-29 12:12:22 +00:00
const SharedHandle<PieceStorage>& getPieceStorage() const
{
return pieceStorage_;
2009-05-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> Implemented getter methods in header files to give them more chance of optimization. Return const reference for SharadHandle if possible. * src/AbstractAuthResolver.cc * src/AbstractAuthResolver.h * src/AbstractBtMessage.cc * src/AbstractBtMessage.h * src/AbstractSingleDiskAdaptor.cc * src/AbstractSingleDiskAdaptor.h * src/AsyncNameResolver.cc * src/AsyncNameResolver.h * src/BNode.cc * src/BNode.h * src/BitfieldMan.cc * src/BitfieldMan.h * src/BtAbortOutstandingRequestEvent.h * src/BtExtendedMessage.cc * src/BtExtendedMessage.h * src/BtSeederStateChoke.cc * src/BtSeederStateChoke.h * src/Cookie.cc * src/Cookie.h * src/DHTBucket.cc * src/DHTBucket.h * src/DHTConnectionImpl.cc * src/DHTConnectionImpl.h * src/DHTFindNodeReplyMessage.cc * src/DHTFindNodeReplyMessage.h * src/DHTGetPeersReplyMessage.cc * src/DHTGetPeersReplyMessage.h * src/DHTInteractionCommand.cc * src/DHTMessage.cc * src/DHTMessage.h * src/DHTMessageDispatcherImpl.cc * src/DHTMessageEntry.cc * src/DHTMessageReceiver.cc * src/DHTMessageReceiver.h * src/DHTMessageTrackerEntry.cc * src/DHTMessageTrackerEntry.h * src/DHTPeerAnnounceEntry.cc * src/DHTPeerAnnounceEntry.h * src/DHTPeerLookupTask.cc * src/DHTPeerLookupTask.h * src/DHTRoutingTableDeserializer.cc * src/DHTRoutingTableDeserializer.h * src/DefaultBtAnnounce.cc * src/DefaultBtAnnounce.h * src/DefaultBtMessageDispatcher.cc * src/DefaultBtMessageDispatcher.h * src/DefaultBtRequestFactory.cc * src/DefaultBtRequestFactory.h * src/DiskAdaptor.cc * src/DiskAdaptor.h * src/DownloadContext.cc * src/DownloadContext.h * src/DownloadEngine.cc * src/DownloadEngine.h * src/EpollEventPoll.cc * src/EpollEventPoll.h * src/FtpConnection.cc * src/FtpConnection.h * src/HttpConnection.cc * src/HttpConnection.h * src/HttpHeader.cc * src/HttpHeader.h * src/HttpRequest.cc * src/HttpRequest.h * src/HttpResponse.cc * src/HttpResponse.h * src/LibsslTLSContext.cc * src/LibsslTLSContext.h * src/MSEHandshake.cc * src/MSEHandshake.h * src/MetalinkEntry.cc * src/MetalinkEntry.h * src/MetalinkParserController.cc * src/MetalinkParserController.h * src/MetalinkParserStateMachine.cc * src/MetalinkParserStateMachine.h * src/MultiDiskAdaptor.cc * src/MultiDiskAdaptor.h * src/NetrcAuthResolver.cc * src/NetrcAuthResolver.h * src/Peer.cc * src/Peer.h * src/PeerSessionResource.cc * src/PeerSessionResource.h * src/Piece.cc * src/Piece.h * src/PieceStatMan.cc * src/PieceStatMan.h * src/Request.cc * src/Request.h * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/RequestGroupMan.h * src/RequestSlot.cc * src/RequestSlot.h * src/SegmentMan.cc * src/SegmentMan.h * src/SelectEventPoll.cc * src/SelectEventPoll.h * src/ServerStat.cc * src/ServerStat.h * src/Signature.cc * src/Signature.h * src/URIResult.cc * src/URIResult.h * src/UTPexExtensionMessage.cc * src/UTPexExtensionMessage.h
2009-05-29 12:12:22 +00:00
}
void setPieceStorage(const SharedHandle<PieceStorage>& pieceStorage);
void setProgressInfoFile(const SharedHandle<BtProgressInfoFile>& progressInfoFile);
void increaseStreamCommand();
void decreaseStreamCommand();
void increaseStreamConnection();
void decreaseStreamConnection();
int getNumConnection() const;
void increaseNumCommand();
void decreaseNumCommand();
int getNumCommand() const
{
return numCommand_;
}
// TODO is it better to move the following 2 methods to SingleFileDownloadContext?
void setDiskWriterFactory(const SharedHandle<DiskWriterFactory>& diskWriterFactory);
2009-05-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> Implemented getter methods in header files to give them more chance of optimization. Return const reference for SharadHandle if possible. * src/AbstractAuthResolver.cc * src/AbstractAuthResolver.h * src/AbstractBtMessage.cc * src/AbstractBtMessage.h * src/AbstractSingleDiskAdaptor.cc * src/AbstractSingleDiskAdaptor.h * src/AsyncNameResolver.cc * src/AsyncNameResolver.h * src/BNode.cc * src/BNode.h * src/BitfieldMan.cc * src/BitfieldMan.h * src/BtAbortOutstandingRequestEvent.h * src/BtExtendedMessage.cc * src/BtExtendedMessage.h * src/BtSeederStateChoke.cc * src/BtSeederStateChoke.h * src/Cookie.cc * src/Cookie.h * src/DHTBucket.cc * src/DHTBucket.h * src/DHTConnectionImpl.cc * src/DHTConnectionImpl.h * src/DHTFindNodeReplyMessage.cc * src/DHTFindNodeReplyMessage.h * src/DHTGetPeersReplyMessage.cc * src/DHTGetPeersReplyMessage.h * src/DHTInteractionCommand.cc * src/DHTMessage.cc * src/DHTMessage.h * src/DHTMessageDispatcherImpl.cc * src/DHTMessageEntry.cc * src/DHTMessageReceiver.cc * src/DHTMessageReceiver.h * src/DHTMessageTrackerEntry.cc * src/DHTMessageTrackerEntry.h * src/DHTPeerAnnounceEntry.cc * src/DHTPeerAnnounceEntry.h * src/DHTPeerLookupTask.cc * src/DHTPeerLookupTask.h * src/DHTRoutingTableDeserializer.cc * src/DHTRoutingTableDeserializer.h * src/DefaultBtAnnounce.cc * src/DefaultBtAnnounce.h * src/DefaultBtMessageDispatcher.cc * src/DefaultBtMessageDispatcher.h * src/DefaultBtRequestFactory.cc * src/DefaultBtRequestFactory.h * src/DiskAdaptor.cc * src/DiskAdaptor.h * src/DownloadContext.cc * src/DownloadContext.h * src/DownloadEngine.cc * src/DownloadEngine.h * src/EpollEventPoll.cc * src/EpollEventPoll.h * src/FtpConnection.cc * src/FtpConnection.h * src/HttpConnection.cc * src/HttpConnection.h * src/HttpHeader.cc * src/HttpHeader.h * src/HttpRequest.cc * src/HttpRequest.h * src/HttpResponse.cc * src/HttpResponse.h * src/LibsslTLSContext.cc * src/LibsslTLSContext.h * src/MSEHandshake.cc * src/MSEHandshake.h * src/MetalinkEntry.cc * src/MetalinkEntry.h * src/MetalinkParserController.cc * src/MetalinkParserController.h * src/MetalinkParserStateMachine.cc * src/MetalinkParserStateMachine.h * src/MultiDiskAdaptor.cc * src/MultiDiskAdaptor.h * src/NetrcAuthResolver.cc * src/NetrcAuthResolver.h * src/Peer.cc * src/Peer.h * src/PeerSessionResource.cc * src/PeerSessionResource.h * src/Piece.cc * src/Piece.h * src/PieceStatMan.cc * src/PieceStatMan.h * src/Request.cc * src/Request.h * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/RequestGroupMan.h * src/RequestSlot.cc * src/RequestSlot.h * src/SegmentMan.cc * src/SegmentMan.h * src/SelectEventPoll.cc * src/SelectEventPoll.h * src/ServerStat.cc * src/ServerStat.h * src/Signature.cc * src/Signature.h * src/URIResult.cc * src/URIResult.h * src/UTPexExtensionMessage.cc * src/UTPexExtensionMessage.h
2009-05-29 12:12:22 +00:00
const SharedHandle<DiskWriterFactory>& getDiskWriterFactory() const
{
return diskWriterFactory_;
2009-05-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> Implemented getter methods in header files to give them more chance of optimization. Return const reference for SharadHandle if possible. * src/AbstractAuthResolver.cc * src/AbstractAuthResolver.h * src/AbstractBtMessage.cc * src/AbstractBtMessage.h * src/AbstractSingleDiskAdaptor.cc * src/AbstractSingleDiskAdaptor.h * src/AsyncNameResolver.cc * src/AsyncNameResolver.h * src/BNode.cc * src/BNode.h * src/BitfieldMan.cc * src/BitfieldMan.h * src/BtAbortOutstandingRequestEvent.h * src/BtExtendedMessage.cc * src/BtExtendedMessage.h * src/BtSeederStateChoke.cc * src/BtSeederStateChoke.h * src/Cookie.cc * src/Cookie.h * src/DHTBucket.cc * src/DHTBucket.h * src/DHTConnectionImpl.cc * src/DHTConnectionImpl.h * src/DHTFindNodeReplyMessage.cc * src/DHTFindNodeReplyMessage.h * src/DHTGetPeersReplyMessage.cc * src/DHTGetPeersReplyMessage.h * src/DHTInteractionCommand.cc * src/DHTMessage.cc * src/DHTMessage.h * src/DHTMessageDispatcherImpl.cc * src/DHTMessageEntry.cc * src/DHTMessageReceiver.cc * src/DHTMessageReceiver.h * src/DHTMessageTrackerEntry.cc * src/DHTMessageTrackerEntry.h * src/DHTPeerAnnounceEntry.cc * src/DHTPeerAnnounceEntry.h * src/DHTPeerLookupTask.cc * src/DHTPeerLookupTask.h * src/DHTRoutingTableDeserializer.cc * src/DHTRoutingTableDeserializer.h * src/DefaultBtAnnounce.cc * src/DefaultBtAnnounce.h * src/DefaultBtMessageDispatcher.cc * src/DefaultBtMessageDispatcher.h * src/DefaultBtRequestFactory.cc * src/DefaultBtRequestFactory.h * src/DiskAdaptor.cc * src/DiskAdaptor.h * src/DownloadContext.cc * src/DownloadContext.h * src/DownloadEngine.cc * src/DownloadEngine.h * src/EpollEventPoll.cc * src/EpollEventPoll.h * src/FtpConnection.cc * src/FtpConnection.h * src/HttpConnection.cc * src/HttpConnection.h * src/HttpHeader.cc * src/HttpHeader.h * src/HttpRequest.cc * src/HttpRequest.h * src/HttpResponse.cc * src/HttpResponse.h * src/LibsslTLSContext.cc * src/LibsslTLSContext.h * src/MSEHandshake.cc * src/MSEHandshake.h * src/MetalinkEntry.cc * src/MetalinkEntry.h * src/MetalinkParserController.cc * src/MetalinkParserController.h * src/MetalinkParserStateMachine.cc * src/MetalinkParserStateMachine.h * src/MultiDiskAdaptor.cc * src/MultiDiskAdaptor.h * src/NetrcAuthResolver.cc * src/NetrcAuthResolver.h * src/Peer.cc * src/Peer.h * src/PeerSessionResource.cc * src/PeerSessionResource.h * src/Piece.cc * src/Piece.h * src/PieceStatMan.cc * src/PieceStatMan.h * src/Request.cc * src/Request.h * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/RequestGroupMan.h * src/RequestSlot.cc * src/RequestSlot.h * src/SegmentMan.cc * src/SegmentMan.h * src/SelectEventPoll.cc * src/SelectEventPoll.h * src/ServerStat.cc * src/ServerStat.h * src/Signature.cc * src/Signature.h * src/URIResult.cc * src/URIResult.h * src/UTPexExtensionMessage.cc * src/UTPexExtensionMessage.h
2009-05-29 12:12:22 +00:00
}
void setFileAllocationEnabled(bool f)
{
fileAllocationEnabled_ = f;
}
bool isFileAllocationEnabled() const
{
return fileAllocationEnabled_;
}
bool needsFileAllocation() const;
/**
* Setting preLocalFileCheckEnabled_ to false, then skip the check to see
* if a file is already exists and control file exists etc.
* Always open file with DiskAdaptor::initAndOpenFile()
*/
void setPreLocalFileCheckEnabled(bool f)
{
preLocalFileCheckEnabled_ = f;
}
2007-06-30 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Made -S option work with metalink file and provided selective download to metalink. * src/MetalinkEntry.h, src/MetalinkEntry.cc (filename): Removed. (file): New variable. (size): Removed. (operator=): Updated. (getPath): New function. (getLength): New function. (toFileEntry): New function. * src/TorrentRequestInfo.h, src/TorrentRequestInfo.cc (execute): Use toStream. (showFileEntry): Removed. * src/MetalinkRequestInfo.h (targetFiles): New variable. (setTargetFiles): New variable. * src/MetalinkRequestInfo.cc (execute): Added the ability to print file information included in a metalink file. Added selective download mode to metalink. * src/main.cc (showUsage): Updated to denote that -S and --select-file options are applicable to metalink. * src/FileEntry.h (operator=): New function. (getBasename): New function. (getDirname): New function. * src/Util.h, src/Util.cc (toStream): New function. * src/Xml2MetalinkProcessor.cc: Updated. Made aria2 work with metalink with directory structure. * src/File.h, src/File.cc (getBasename): New function. (getDirname): New function. * src/RequestGroup.h, src/RequestGroup.cc (_topDir): New variable. (setTopDir): New function. (initSegmentMan): A directory structure is added to _segmentMan->dir. Rewrote HTTP header parsing with stringstream. * src/HttpConnection.h, src/HttpConnection.cc (HttpRequestEntry): New class. (headerBuf): Removed. (headerBufLength): Removed. (outstandingHttpRequests): Now its element type is HttpRequestEntryHandle. (findEndOfHeader): Removed. (receiveResponse): Rewritten. Updated doc for -j option to notice that it should be used with -i option. * src/main.cc (showUsage) Removed unused classes. * src/RequestInfo.h (FileInfo): Removed. (checksum): Removed. (fileInfo): Removed. (setChecksum): Removed. (getChecksum): Removed. (getFileInfo): Removed. Use ISO units. * src/ConsoleDownloadEngine.cc * src/TorrentConsoleDownloadEngine.cc * src/Util.cc (abbrevSize)
2007-06-30 09:52:39 +00:00
bool isPreLocalFileCheckEnabled() const
2007-06-30 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Made -S option work with metalink file and provided selective download to metalink. * src/MetalinkEntry.h, src/MetalinkEntry.cc (filename): Removed. (file): New variable. (size): Removed. (operator=): Updated. (getPath): New function. (getLength): New function. (toFileEntry): New function. * src/TorrentRequestInfo.h, src/TorrentRequestInfo.cc (execute): Use toStream. (showFileEntry): Removed. * src/MetalinkRequestInfo.h (targetFiles): New variable. (setTargetFiles): New variable. * src/MetalinkRequestInfo.cc (execute): Added the ability to print file information included in a metalink file. Added selective download mode to metalink. * src/main.cc (showUsage): Updated to denote that -S and --select-file options are applicable to metalink. * src/FileEntry.h (operator=): New function. (getBasename): New function. (getDirname): New function. * src/Util.h, src/Util.cc (toStream): New function. * src/Xml2MetalinkProcessor.cc: Updated. Made aria2 work with metalink with directory structure. * src/File.h, src/File.cc (getBasename): New function. (getDirname): New function. * src/RequestGroup.h, src/RequestGroup.cc (_topDir): New variable. (setTopDir): New function. (initSegmentMan): A directory structure is added to _segmentMan->dir. Rewrote HTTP header parsing with stringstream. * src/HttpConnection.h, src/HttpConnection.cc (HttpRequestEntry): New class. (headerBuf): Removed. (headerBufLength): Removed. (outstandingHttpRequests): Now its element type is HttpRequestEntryHandle. (findEndOfHeader): Removed. (receiveResponse): Rewritten. Updated doc for -j option to notice that it should be used with -i option. * src/main.cc (showUsage) Removed unused classes. * src/RequestInfo.h (FileInfo): Removed. (checksum): Removed. (fileInfo): Removed. (setChecksum): Removed. (getChecksum): Removed. (getFileInfo): Removed. Use ISO units. * src/ConsoleDownloadEngine.cc * src/TorrentConsoleDownloadEngine.cc * src/Util.cc (abbrevSize)
2007-06-30 09:52:39 +00:00
{
return preLocalFileCheckEnabled_;
2007-06-30 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Made -S option work with metalink file and provided selective download to metalink. * src/MetalinkEntry.h, src/MetalinkEntry.cc (filename): Removed. (file): New variable. (size): Removed. (operator=): Updated. (getPath): New function. (getLength): New function. (toFileEntry): New function. * src/TorrentRequestInfo.h, src/TorrentRequestInfo.cc (execute): Use toStream. (showFileEntry): Removed. * src/MetalinkRequestInfo.h (targetFiles): New variable. (setTargetFiles): New variable. * src/MetalinkRequestInfo.cc (execute): Added the ability to print file information included in a metalink file. Added selective download mode to metalink. * src/main.cc (showUsage): Updated to denote that -S and --select-file options are applicable to metalink. * src/FileEntry.h (operator=): New function. (getBasename): New function. (getDirname): New function. * src/Util.h, src/Util.cc (toStream): New function. * src/Xml2MetalinkProcessor.cc: Updated. Made aria2 work with metalink with directory structure. * src/File.h, src/File.cc (getBasename): New function. (getDirname): New function. * src/RequestGroup.h, src/RequestGroup.cc (_topDir): New variable. (setTopDir): New function. (initSegmentMan): A directory structure is added to _segmentMan->dir. Rewrote HTTP header parsing with stringstream. * src/HttpConnection.h, src/HttpConnection.cc (HttpRequestEntry): New class. (headerBuf): Removed. (headerBufLength): Removed. (outstandingHttpRequests): Now its element type is HttpRequestEntryHandle. (findEndOfHeader): Removed. (receiveResponse): Rewritten. Updated doc for -j option to notice that it should be used with -i option. * src/main.cc (showUsage) Removed unused classes. * src/RequestInfo.h (FileInfo): Removed. (checksum): Removed. (fileInfo): Removed. (setChecksum): Removed. (getChecksum): Removed. (getFileInfo): Removed. Use ISO units. * src/ConsoleDownloadEngine.cc * src/TorrentConsoleDownloadEngine.cc * src/Util.cc (abbrevSize)
2007-06-30 09:52:39 +00:00
}
void setHaltRequested(bool f, HaltReason = SHUTDOWN_SIGNAL);
void setForceHaltRequested(bool f, HaltReason = SHUTDOWN_SIGNAL);
bool isHaltRequested() const
{
return haltRequested_;
}
bool isForceHaltRequested() const
{
return forceHaltRequested_;
}
void setPauseRequested(bool f);
bool isPauseRequested() const
{
return pauseRequested_;
}
void dependsOn(const SharedHandle<Dependency>& dep);
bool isDependencyResolved();
2008-11-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Made BtRegistry non-static object. Now DownloadEngine has a reference to its object. * src/AbstractBtMessage.cc * src/ActivePeerConnectionCommand.cc * src/ActivePeerConnectionCommand.h * src/BtContextAwareCommand.cc * src/BtContextAwareCommand.h * src/BtExtendedMessage.cc * src/BtExtendedMessage.h * src/BtInterestedMessage.cc * src/BtInterestedMessage.h * src/BtNotInterestedMessage.cc * src/BtNotInterestedMessage.h * src/BtRegistry.cc * src/BtRegistry.h * src/BtSeederStateChoke.cc * src/BtSetup.cc * src/DHTGetPeersCommand.cc * src/DHTGetPeersCommand.h * src/DHTPeerAnnounceEntry.cc * src/DHTPeerAnnounceEntry.h * src/DHTPeerAnnounceStorage.cc * src/DHTPeerAnnounceStorage.h * src/DHTPeerLookupTask.cc * src/DHTPeerLookupTask.h * src/DHTSetup.cc * src/DHTSetup.h * src/DHTTaskFactory.h * src/DHTTaskFactoryImpl.cc * src/DHTTaskFactoryImpl.h * src/DefaultBtAnnounce.cc * src/DefaultBtInteractive.cc * src/DefaultBtInteractive.h * src/DefaultBtMessageDispatcher.cc * src/DefaultBtMessageDispatcher.h * src/DefaultBtMessageFactory.cc * src/DefaultBtMessageFactory.h * src/DefaultBtMessageReceiver.cc * src/DefaultBtProgressInfoFile.cc * src/DefaultBtProgressInfoFile.h * src/DefaultBtRequestFactory.cc * src/DefaultBtRequestFactory.h * src/DefaultExtensionMessageFactory.cc * src/DefaultExtensionMessageFactory.h * src/DefaultPeerStorage.cc * src/DefaultPeerStorage.h * src/DownloadEngine.cc * src/DownloadEngine.h * src/InitiatorMSEHandshakeCommand.cc * src/InitiatorMSEHandshakeCommand.h * src/MSEHandshake.cc * src/MSEHandshake.h * src/Makefile.am * src/Makefile.in * src/PeerChokeCommand.cc * src/PeerChokeCommand.h * src/PeerInitiateConnectionCommand.cc * src/PeerInitiateConnectionCommand.h * src/PeerInteractionCommand.cc * src/PeerInteractionCommand.h * src/PeerObject.h * src/PeerReceiveHandshakeCommand.cc * src/PeerReceiveHandshakeCommand.h * src/ReceiverMSEHandshakeCommand.cc * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/RequestGroupMan.h * src/SeedCheckCommand.cc * src/SeedCheckCommand.h * src/ShareRatioSeedCriteria.h * src/SimpleBtMessage.cc * src/TrackerWatcherCommand.cc * src/TrackerWatcherCommand.h * src/UTPexExtensionMessage.cc * src/UTPexExtensionMessage.h * test/BtCancelMessageTest.cc * test/BtChokeMessageTest.cc * test/BtExtendedMessageTest.cc * test/BtInterestedMessageTest.cc * test/BtNotInterestedMessageTest.cc * test/BtPieceMessageTest.cc * test/BtPortMessageTest.cc * test/BtRegistryTest.cc * test/BtRejectMessageTest.cc * test/BtRequestMessageTest.cc * test/DHTPeerAnnounceEntryTest.cc * test/DHTPeerAnnounceStorageTest.cc * test/DefaultBtMessageDispatcherTest.cc * test/DefaultBtMessageFactoryTest.cc * test/DefaultBtProgressInfoFileTest.cc * test/DefaultBtRequestFactoryTest.cc * test/DefaultExtensionMessageFactoryTest.cc * test/MSEHandshakeTest.cc * test/MockDHTTaskFactory.h * test/ShareRatioSeedCriteriaTest.cc * test/UTPexExtensionMessageTest.cc
2008-11-03 06:49:02 +00:00
void releaseRuntimeResource(DownloadEngine* e);
void postDownloadProcessing(std::vector<SharedHandle<RequestGroup> >& groups);
void addPostDownloadHandler(const SharedHandle<PostDownloadHandler>& handler);
void clearPostDownloadHandler();
2007-11-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Don't connect server before checking file integrity at startup, if filesize and output file path are known. * src/AbstractCommand.cc * src/StreamFileAllocationEntry.cc * src/Metalink2RequestGroup.cc * src/RequestGroup.{h, cc} * src/HttpResponseCommand.cc * src/FtpNegotiationCommand.cc Added DownloadFailureException. If it is thrown, RequestGroup should halt. * src/AbstractCommand.cc * src/DownloadFailureException.h * src/RequestGroup.cc Catch RecoverableException, instead of DlAbortEx. * src/RequestGroupMan.cc * src/FillRequestGroupCommand.cc * src/MetaFileUtil.cc * src/IteratableChunkChecksumValidator.cc Now first parameter of MSG_DOWNLOAD_ABORTED is gid(RequestGroup:: getGID()) * src/CheckIntegrityCommand.cc * src/message.h Print gid instead of idx. * src/RequestGroupMan.cc Removed exception throwers declaration. * src/DirectDiskAdaptor.{h, cc} * src/SocketCore.{h, cc} * src/MultiDiskAdaptor.{h, cc} * src/HttpConnection.{h, cc} * src/HttpResponse.{h, cc} * src/DiskAdaptor.{h, cc} * src/CopyDiskAdaptor.{h, cc} * src/MultiDiskAdaptor.{h, cc} * src/HttpHeaderProcessor.{h, cc} * src/AbstractSingleDiskAdaptor.{h, cc} * src/Util.{h, cc} * test/UtilTest.cc * src/DefaultDiskWriter.{h, cc} * src/FtpConnection.{h, cc} * src/AbstractDiskWriter.{h, cc} Removed duplicate code. * src/StreamCheckIntegrityEntry.cc Removed unnecessary include. * src/DiskWriter.h Included Exception.h * src/option_processing.cc Included 2 files and added doc * src/TrackerWatcherCommand.cc * src/SocketCore.cc (writeData): Fixed send error with GnuTLS.
2007-11-09 18:01:12 +00:00
2007-11-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Rewritten to add content-type support. * src/DownloadHandler.{h, cc} * src/BtPostDownloadHandler.{h, cc} * test/BtPostDownloadHandlerTest.cc * src/MetalinkPostDownloadHandler.{h, cc} * test/MetalinkPostDownloadHandlerTest.cc * src/PostDownloadHandler.{h, cc} * src/DownloadHandlerConstants.{h, cc} * src/RequestGroup.cc * src/HttpResponseCommand.cc * src/FtpNegotiationCommand.cc * src/SingleFileDownloadContext.{h, cc} * src/RequestGroup.h * src/RequestGroupCriteria.h * src/ContentTypeRequestGroupCriteria.h Added 'mem' option value for --follow-metalink, --follow-torrent. If it is give, metalink/torrent file is not written to the disk, but just is kept in memory. Parsing is occurred on memory. * src/MetalinkHelper.{h, cc} * src/MetalinkProcessor.h * src/Xml2MetalinkProcessor.{h, cc} * test/Xml2MetalinkProcessorTest.cc * src/DownloadHandlerFactory.{h, cc} * test/DownloadHandlerFactoryTest.cc * src/PreDownloadHandler.{h, cc} * src/OptionHandlerFactory.cc * src/DefaultBtContext.{h, cc} * test/DefaultBtContextTest.cc * src/version_usage.cc * src/Metalink2RequestGroup.{h, cc} * src/RequestGroup.{h, cc} * src/a2functional.h * test/a2functionalTest.cc * src/MemoryBufferPreDownloadHandler.{h, cc} * src/OptionHandlerImpl.h * src/prefs.h * src/Util.{h, cc} * test/UtilTest.cc Keep DownloadResult rather than RequestGroup after downloads to reduce memory usage. * src/RequestGroupMan.{h, cc} * src/DownloadEngine.cc * src/BtDependency.{h, cc}: Changed the type of dependee from WeakHandle to SharedHandle because WeakHandle could be null. * src/RequestGroup.{h, cc} * src/DownloadEngineFactory.cc * src/DownloadResult.h Set totalLength after download finished * src/UnknownLengthPieceStorage.{h, cc} Keep torrent file specified in metalink in memory. * src/Metalink2RequestGroup.cc * src/BtDependency.cc * src/TrueRequestGroupCriteria.h Fixed the bug: seekg is used where seekp should be used. * src/ByteArrayDiskWriter.cc * test/ByteArraydiskWriterTest.cc
2007-11-27 12:27:10 +00:00
void preDownloadProcessing();
void addPreDownloadHandler(const SharedHandle<PreDownloadHandler>& handler);
2007-11-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Rewritten to add content-type support. * src/DownloadHandler.{h, cc} * src/BtPostDownloadHandler.{h, cc} * test/BtPostDownloadHandlerTest.cc * src/MetalinkPostDownloadHandler.{h, cc} * test/MetalinkPostDownloadHandlerTest.cc * src/PostDownloadHandler.{h, cc} * src/DownloadHandlerConstants.{h, cc} * src/RequestGroup.cc * src/HttpResponseCommand.cc * src/FtpNegotiationCommand.cc * src/SingleFileDownloadContext.{h, cc} * src/RequestGroup.h * src/RequestGroupCriteria.h * src/ContentTypeRequestGroupCriteria.h Added 'mem' option value for --follow-metalink, --follow-torrent. If it is give, metalink/torrent file is not written to the disk, but just is kept in memory. Parsing is occurred on memory. * src/MetalinkHelper.{h, cc} * src/MetalinkProcessor.h * src/Xml2MetalinkProcessor.{h, cc} * test/Xml2MetalinkProcessorTest.cc * src/DownloadHandlerFactory.{h, cc} * test/DownloadHandlerFactoryTest.cc * src/PreDownloadHandler.{h, cc} * src/OptionHandlerFactory.cc * src/DefaultBtContext.{h, cc} * test/DefaultBtContextTest.cc * src/version_usage.cc * src/Metalink2RequestGroup.{h, cc} * src/RequestGroup.{h, cc} * src/a2functional.h * test/a2functionalTest.cc * src/MemoryBufferPreDownloadHandler.{h, cc} * src/OptionHandlerImpl.h * src/prefs.h * src/Util.{h, cc} * test/UtilTest.cc Keep DownloadResult rather than RequestGroup after downloads to reduce memory usage. * src/RequestGroupMan.{h, cc} * src/DownloadEngine.cc * src/BtDependency.{h, cc}: Changed the type of dependee from WeakHandle to SharedHandle because WeakHandle could be null. * src/RequestGroup.{h, cc} * src/DownloadEngineFactory.cc * src/DownloadResult.h Set totalLength after download finished * src/UnknownLengthPieceStorage.{h, cc} Keep torrent file specified in metalink in memory. * src/Metalink2RequestGroup.cc * src/BtDependency.cc * src/TrueRequestGroupCriteria.h Fixed the bug: seekg is used where seekp should be used. * src/ByteArrayDiskWriter.cc * test/ByteArraydiskWriterTest.cc
2007-11-27 12:27:10 +00:00
void clearPreDownloadHandler();
2007-11-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Rewritten to add content-type support. * src/DownloadHandler.{h, cc} * src/BtPostDownloadHandler.{h, cc} * test/BtPostDownloadHandlerTest.cc * src/MetalinkPostDownloadHandler.{h, cc} * test/MetalinkPostDownloadHandlerTest.cc * src/PostDownloadHandler.{h, cc} * src/DownloadHandlerConstants.{h, cc} * src/RequestGroup.cc * src/HttpResponseCommand.cc * src/FtpNegotiationCommand.cc * src/SingleFileDownloadContext.{h, cc} * src/RequestGroup.h * src/RequestGroupCriteria.h * src/ContentTypeRequestGroupCriteria.h Added 'mem' option value for --follow-metalink, --follow-torrent. If it is give, metalink/torrent file is not written to the disk, but just is kept in memory. Parsing is occurred on memory. * src/MetalinkHelper.{h, cc} * src/MetalinkProcessor.h * src/Xml2MetalinkProcessor.{h, cc} * test/Xml2MetalinkProcessorTest.cc * src/DownloadHandlerFactory.{h, cc} * test/DownloadHandlerFactoryTest.cc * src/PreDownloadHandler.{h, cc} * src/OptionHandlerFactory.cc * src/DefaultBtContext.{h, cc} * test/DefaultBtContextTest.cc * src/version_usage.cc * src/Metalink2RequestGroup.{h, cc} * src/RequestGroup.{h, cc} * src/a2functional.h * test/a2functionalTest.cc * src/MemoryBufferPreDownloadHandler.{h, cc} * src/OptionHandlerImpl.h * src/prefs.h * src/Util.{h, cc} * test/UtilTest.cc Keep DownloadResult rather than RequestGroup after downloads to reduce memory usage. * src/RequestGroupMan.{h, cc} * src/DownloadEngine.cc * src/BtDependency.{h, cc}: Changed the type of dependee from WeakHandle to SharedHandle because WeakHandle could be null. * src/RequestGroup.{h, cc} * src/DownloadEngineFactory.cc * src/DownloadResult.h Set totalLength after download finished * src/UnknownLengthPieceStorage.{h, cc} Keep torrent file specified in metalink in memory. * src/Metalink2RequestGroup.cc * src/BtDependency.cc * src/TrueRequestGroupCriteria.h Fixed the bug: seekg is used where seekp should be used. * src/ByteArrayDiskWriter.cc * test/ByteArraydiskWriterTest.cc
2007-11-27 12:27:10 +00:00
void processCheckIntegrityEntry(std::vector<Command*>& commands,
const SharedHandle<CheckIntegrityEntry>& entry,
DownloadEngine* e);
2007-11-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Don't connect server before checking file integrity at startup, if filesize and output file path are known. * src/AbstractCommand.cc * src/StreamFileAllocationEntry.cc * src/Metalink2RequestGroup.cc * src/RequestGroup.{h, cc} * src/HttpResponseCommand.cc * src/FtpNegotiationCommand.cc Added DownloadFailureException. If it is thrown, RequestGroup should halt. * src/AbstractCommand.cc * src/DownloadFailureException.h * src/RequestGroup.cc Catch RecoverableException, instead of DlAbortEx. * src/RequestGroupMan.cc * src/FillRequestGroupCommand.cc * src/MetaFileUtil.cc * src/IteratableChunkChecksumValidator.cc Now first parameter of MSG_DOWNLOAD_ABORTED is gid(RequestGroup:: getGID()) * src/CheckIntegrityCommand.cc * src/message.h Print gid instead of idx. * src/RequestGroupMan.cc Removed exception throwers declaration. * src/DirectDiskAdaptor.{h, cc} * src/SocketCore.{h, cc} * src/MultiDiskAdaptor.{h, cc} * src/HttpConnection.{h, cc} * src/HttpResponse.{h, cc} * src/DiskAdaptor.{h, cc} * src/CopyDiskAdaptor.{h, cc} * src/MultiDiskAdaptor.{h, cc} * src/HttpHeaderProcessor.{h, cc} * src/AbstractSingleDiskAdaptor.{h, cc} * src/Util.{h, cc} * test/UtilTest.cc * src/DefaultDiskWriter.{h, cc} * src/FtpConnection.{h, cc} * src/AbstractDiskWriter.{h, cc} Removed duplicate code. * src/StreamCheckIntegrityEntry.cc Removed unnecessary include. * src/DiskWriter.h Included Exception.h * src/option_processing.cc Included 2 files and added doc * src/TrackerWatcherCommand.cc * src/SocketCore.cc (writeData): Fixed send error with GnuTLS.
2007-11-09 18:01:12 +00:00
// Initializes pieceStorage_ and segmentMan_. We guarantee that
// either both of pieceStorage_ and segmentMan_ are initialized or
// they are not.
2007-11-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Don't connect server before checking file integrity at startup, if filesize and output file path are known. * src/AbstractCommand.cc * src/StreamFileAllocationEntry.cc * src/Metalink2RequestGroup.cc * src/RequestGroup.{h, cc} * src/HttpResponseCommand.cc * src/FtpNegotiationCommand.cc Added DownloadFailureException. If it is thrown, RequestGroup should halt. * src/AbstractCommand.cc * src/DownloadFailureException.h * src/RequestGroup.cc Catch RecoverableException, instead of DlAbortEx. * src/RequestGroupMan.cc * src/FillRequestGroupCommand.cc * src/MetaFileUtil.cc * src/IteratableChunkChecksumValidator.cc Now first parameter of MSG_DOWNLOAD_ABORTED is gid(RequestGroup:: getGID()) * src/CheckIntegrityCommand.cc * src/message.h Print gid instead of idx. * src/RequestGroupMan.cc Removed exception throwers declaration. * src/DirectDiskAdaptor.{h, cc} * src/SocketCore.{h, cc} * src/MultiDiskAdaptor.{h, cc} * src/HttpConnection.{h, cc} * src/HttpResponse.{h, cc} * src/DiskAdaptor.{h, cc} * src/CopyDiskAdaptor.{h, cc} * src/MultiDiskAdaptor.{h, cc} * src/HttpHeaderProcessor.{h, cc} * src/AbstractSingleDiskAdaptor.{h, cc} * src/Util.{h, cc} * test/UtilTest.cc * src/DefaultDiskWriter.{h, cc} * src/FtpConnection.{h, cc} * src/AbstractDiskWriter.{h, cc} Removed duplicate code. * src/StreamCheckIntegrityEntry.cc Removed unnecessary include. * src/DiskWriter.h Included Exception.h * src/option_processing.cc Included 2 files and added doc * src/TrackerWatcherCommand.cc * src/SocketCore.cc (writeData): Fixed send error with GnuTLS.
2007-11-09 18:01:12 +00:00
void initPieceStorage();
void dropPieceStorage();
2007-11-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Don't connect server before checking file integrity at startup, if filesize and output file path are known. * src/AbstractCommand.cc * src/StreamFileAllocationEntry.cc * src/Metalink2RequestGroup.cc * src/RequestGroup.{h, cc} * src/HttpResponseCommand.cc * src/FtpNegotiationCommand.cc Added DownloadFailureException. If it is thrown, RequestGroup should halt. * src/AbstractCommand.cc * src/DownloadFailureException.h * src/RequestGroup.cc Catch RecoverableException, instead of DlAbortEx. * src/RequestGroupMan.cc * src/FillRequestGroupCommand.cc * src/MetaFileUtil.cc * src/IteratableChunkChecksumValidator.cc Now first parameter of MSG_DOWNLOAD_ABORTED is gid(RequestGroup:: getGID()) * src/CheckIntegrityCommand.cc * src/message.h Print gid instead of idx. * src/RequestGroupMan.cc Removed exception throwers declaration. * src/DirectDiskAdaptor.{h, cc} * src/SocketCore.{h, cc} * src/MultiDiskAdaptor.{h, cc} * src/HttpConnection.{h, cc} * src/HttpResponse.{h, cc} * src/DiskAdaptor.{h, cc} * src/CopyDiskAdaptor.{h, cc} * src/MultiDiskAdaptor.{h, cc} * src/HttpHeaderProcessor.{h, cc} * src/AbstractSingleDiskAdaptor.{h, cc} * src/Util.{h, cc} * test/UtilTest.cc * src/DefaultDiskWriter.{h, cc} * src/FtpConnection.{h, cc} * src/AbstractDiskWriter.{h, cc} Removed duplicate code. * src/StreamCheckIntegrityEntry.cc Removed unnecessary include. * src/DiskWriter.h Included Exception.h * src/option_processing.cc Included 2 files and added doc * src/TrackerWatcherCommand.cc * src/SocketCore.cc (writeData): Fixed send error with GnuTLS.
2007-11-09 18:01:12 +00:00
bool downloadFinishedByFileLength();
void loadAndOpenFile(const SharedHandle<BtProgressInfoFile>& progressInfoFile);
2007-11-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Don't connect server before checking file integrity at startup, if filesize and output file path are known. * src/AbstractCommand.cc * src/StreamFileAllocationEntry.cc * src/Metalink2RequestGroup.cc * src/RequestGroup.{h, cc} * src/HttpResponseCommand.cc * src/FtpNegotiationCommand.cc Added DownloadFailureException. If it is thrown, RequestGroup should halt. * src/AbstractCommand.cc * src/DownloadFailureException.h * src/RequestGroup.cc Catch RecoverableException, instead of DlAbortEx. * src/RequestGroupMan.cc * src/FillRequestGroupCommand.cc * src/MetaFileUtil.cc * src/IteratableChunkChecksumValidator.cc Now first parameter of MSG_DOWNLOAD_ABORTED is gid(RequestGroup:: getGID()) * src/CheckIntegrityCommand.cc * src/message.h Print gid instead of idx. * src/RequestGroupMan.cc Removed exception throwers declaration. * src/DirectDiskAdaptor.{h, cc} * src/SocketCore.{h, cc} * src/MultiDiskAdaptor.{h, cc} * src/HttpConnection.{h, cc} * src/HttpResponse.{h, cc} * src/DiskAdaptor.{h, cc} * src/CopyDiskAdaptor.{h, cc} * src/MultiDiskAdaptor.{h, cc} * src/HttpHeaderProcessor.{h, cc} * src/AbstractSingleDiskAdaptor.{h, cc} * src/Util.{h, cc} * test/UtilTest.cc * src/DefaultDiskWriter.{h, cc} * src/FtpConnection.{h, cc} * src/AbstractDiskWriter.{h, cc} Removed duplicate code. * src/StreamCheckIntegrityEntry.cc Removed unnecessary include. * src/DiskWriter.h Included Exception.h * src/option_processing.cc Included 2 files and added doc * src/TrackerWatcherCommand.cc * src/SocketCore.cc (writeData): Fixed send error with GnuTLS.
2007-11-09 18:01:12 +00:00
void shouldCancelDownloadForSafety();
2007-11-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Rewritten to add content-type support. * src/DownloadHandler.{h, cc} * src/BtPostDownloadHandler.{h, cc} * test/BtPostDownloadHandlerTest.cc * src/MetalinkPostDownloadHandler.{h, cc} * test/MetalinkPostDownloadHandlerTest.cc * src/PostDownloadHandler.{h, cc} * src/DownloadHandlerConstants.{h, cc} * src/RequestGroup.cc * src/HttpResponseCommand.cc * src/FtpNegotiationCommand.cc * src/SingleFileDownloadContext.{h, cc} * src/RequestGroup.h * src/RequestGroupCriteria.h * src/ContentTypeRequestGroupCriteria.h Added 'mem' option value for --follow-metalink, --follow-torrent. If it is give, metalink/torrent file is not written to the disk, but just is kept in memory. Parsing is occurred on memory. * src/MetalinkHelper.{h, cc} * src/MetalinkProcessor.h * src/Xml2MetalinkProcessor.{h, cc} * test/Xml2MetalinkProcessorTest.cc * src/DownloadHandlerFactory.{h, cc} * test/DownloadHandlerFactoryTest.cc * src/PreDownloadHandler.{h, cc} * src/OptionHandlerFactory.cc * src/DefaultBtContext.{h, cc} * test/DefaultBtContextTest.cc * src/version_usage.cc * src/Metalink2RequestGroup.{h, cc} * src/RequestGroup.{h, cc} * src/a2functional.h * test/a2functionalTest.cc * src/MemoryBufferPreDownloadHandler.{h, cc} * src/OptionHandlerImpl.h * src/prefs.h * src/Util.{h, cc} * test/UtilTest.cc Keep DownloadResult rather than RequestGroup after downloads to reduce memory usage. * src/RequestGroupMan.{h, cc} * src/DownloadEngine.cc * src/BtDependency.{h, cc}: Changed the type of dependee from WeakHandle to SharedHandle because WeakHandle could be null. * src/RequestGroup.{h, cc} * src/DownloadEngineFactory.cc * src/DownloadResult.h Set totalLength after download finished * src/UnknownLengthPieceStorage.{h, cc} Keep torrent file specified in metalink in memory. * src/Metalink2RequestGroup.cc * src/BtDependency.cc * src/TrueRequestGroupCriteria.h Fixed the bug: seekg is used where seekp should be used. * src/ByteArrayDiskWriter.cc * test/ByteArraydiskWriterTest.cc
2007-11-27 12:27:10 +00:00
void adjustFilename(const SharedHandle<BtProgressInfoFile>& infoFile);
SharedHandle<DownloadResult> createDownloadResult() const;
2007-11-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Rewritten to add content-type support. * src/DownloadHandler.{h, cc} * src/BtPostDownloadHandler.{h, cc} * test/BtPostDownloadHandlerTest.cc * src/MetalinkPostDownloadHandler.{h, cc} * test/MetalinkPostDownloadHandlerTest.cc * src/PostDownloadHandler.{h, cc} * src/DownloadHandlerConstants.{h, cc} * src/RequestGroup.cc * src/HttpResponseCommand.cc * src/FtpNegotiationCommand.cc * src/SingleFileDownloadContext.{h, cc} * src/RequestGroup.h * src/RequestGroupCriteria.h * src/ContentTypeRequestGroupCriteria.h Added 'mem' option value for --follow-metalink, --follow-torrent. If it is give, metalink/torrent file is not written to the disk, but just is kept in memory. Parsing is occurred on memory. * src/MetalinkHelper.{h, cc} * src/MetalinkProcessor.h * src/Xml2MetalinkProcessor.{h, cc} * test/Xml2MetalinkProcessorTest.cc * src/DownloadHandlerFactory.{h, cc} * test/DownloadHandlerFactoryTest.cc * src/PreDownloadHandler.{h, cc} * src/OptionHandlerFactory.cc * src/DefaultBtContext.{h, cc} * test/DefaultBtContextTest.cc * src/version_usage.cc * src/Metalink2RequestGroup.{h, cc} * src/RequestGroup.{h, cc} * src/a2functional.h * test/a2functionalTest.cc * src/MemoryBufferPreDownloadHandler.{h, cc} * src/OptionHandlerImpl.h * src/prefs.h * src/Util.{h, cc} * test/UtilTest.cc Keep DownloadResult rather than RequestGroup after downloads to reduce memory usage. * src/RequestGroupMan.{h, cc} * src/DownloadEngine.cc * src/BtDependency.{h, cc}: Changed the type of dependee from WeakHandle to SharedHandle because WeakHandle could be null. * src/RequestGroup.{h, cc} * src/DownloadEngineFactory.cc * src/DownloadResult.h Set totalLength after download finished * src/UnknownLengthPieceStorage.{h, cc} Keep torrent file specified in metalink in memory. * src/Metalink2RequestGroup.cc * src/BtDependency.cc * src/TrueRequestGroupCriteria.h Fixed the bug: seekg is used where seekp should be used. * src/ByteArrayDiskWriter.cc * test/ByteArraydiskWriterTest.cc
2007-11-27 12:27:10 +00:00
2009-05-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> Now RequestGroup has its own copy of Option object. This will help to give custom option for each RequestGroup. addTorrentFile command now takes options. * src/AbstractCommand.cc * src/AbstractCommand.h * src/AbstractProxyRequestCommand.cc * src/ActivePeerConnectionCommand.cc * src/ActivePeerConnectionCommand.h * src/AdaptiveURISelector.cc * src/BtCheckIntegrityEntry.cc * src/BtDependency.cc * src/BtDependency.h * src/BtFileAllocationEntry.cc * src/BtPostDownloadHandler.cc * src/CheckIntegrityEntry.cc * src/DownloadCommand.cc * src/FtpDownloadCommand.cc * src/FtpFinishDownloadCommand.cc * src/FtpInitiateConnectionCommand.cc * src/FtpNegotiationCommand.cc * src/HttpInitiateConnectionCommand.cc * src/HttpRequestCommand.cc * src/HttpResponseCommand.cc * src/HttpSkipResponseCommand.cc * src/InitiateConnectionCommand.cc * src/InitiateConnectionCommandFactory.cc * src/InitiatorMSEHandshakeCommand.cc * src/InitiatorMSEHandshakeCommand.h * src/Metalink2RequestGroup.cc * src/Metalink2RequestGroup.h * src/MetalinkPostDownloadHandler.cc * src/MultiUrlRequestInfo.cc * src/MultiUrlRequestInfo.h * src/PeerAbstractCommand.cc * src/PeerInteractionCommand.cc * src/PeerInteractionCommand.h * src/PeerReceiveHandshakeCommand.cc * src/PeerReceiveHandshakeCommand.h * src/RequestGroup.cc * src/RequestGroup.h * src/TrackerWatcherCommand.cc * src/TrackerWatcherCommand.h * src/XmlRpcMethod.cc * src/XmlRpcMethod.h * src/XmlRpcMethodImpl.cc * src/download_helper.cc * src/download_helper.h * src/main.cc * test/BtDependencyTest.cc * test/BtPostDownloadHandlerTest.cc * test/DefaultBtMessageDispatcherTest.cc * test/DownloadHandlerFactoryTest.cc * test/DownloadHelperTest.cc * test/Metalink2RequestGroupTest.cc * test/MetalinkPostDownloadHandlerTest.cc * test/RequestGroupManTest.cc * test/RequestGroupTest.cc
2009-05-08 16:41:21 +00:00
const SharedHandle<Option>& getOption() const
2007-11-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Rewritten to add content-type support. * src/DownloadHandler.{h, cc} * src/BtPostDownloadHandler.{h, cc} * test/BtPostDownloadHandlerTest.cc * src/MetalinkPostDownloadHandler.{h, cc} * test/MetalinkPostDownloadHandlerTest.cc * src/PostDownloadHandler.{h, cc} * src/DownloadHandlerConstants.{h, cc} * src/RequestGroup.cc * src/HttpResponseCommand.cc * src/FtpNegotiationCommand.cc * src/SingleFileDownloadContext.{h, cc} * src/RequestGroup.h * src/RequestGroupCriteria.h * src/ContentTypeRequestGroupCriteria.h Added 'mem' option value for --follow-metalink, --follow-torrent. If it is give, metalink/torrent file is not written to the disk, but just is kept in memory. Parsing is occurred on memory. * src/MetalinkHelper.{h, cc} * src/MetalinkProcessor.h * src/Xml2MetalinkProcessor.{h, cc} * test/Xml2MetalinkProcessorTest.cc * src/DownloadHandlerFactory.{h, cc} * test/DownloadHandlerFactoryTest.cc * src/PreDownloadHandler.{h, cc} * src/OptionHandlerFactory.cc * src/DefaultBtContext.{h, cc} * test/DefaultBtContextTest.cc * src/version_usage.cc * src/Metalink2RequestGroup.{h, cc} * src/RequestGroup.{h, cc} * src/a2functional.h * test/a2functionalTest.cc * src/MemoryBufferPreDownloadHandler.{h, cc} * src/OptionHandlerImpl.h * src/prefs.h * src/Util.{h, cc} * test/UtilTest.cc Keep DownloadResult rather than RequestGroup after downloads to reduce memory usage. * src/RequestGroupMan.{h, cc} * src/DownloadEngine.cc * src/BtDependency.{h, cc}: Changed the type of dependee from WeakHandle to SharedHandle because WeakHandle could be null. * src/RequestGroup.{h, cc} * src/DownloadEngineFactory.cc * src/DownloadResult.h Set totalLength after download finished * src/UnknownLengthPieceStorage.{h, cc} Keep torrent file specified in metalink in memory. * src/Metalink2RequestGroup.cc * src/BtDependency.cc * src/TrueRequestGroupCriteria.h Fixed the bug: seekg is used where seekp should be used. * src/ByteArrayDiskWriter.cc * test/ByteArraydiskWriterTest.cc
2007-11-27 12:27:10 +00:00
{
return option_;
2007-11-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com> Rewritten to add content-type support. * src/DownloadHandler.{h, cc} * src/BtPostDownloadHandler.{h, cc} * test/BtPostDownloadHandlerTest.cc * src/MetalinkPostDownloadHandler.{h, cc} * test/MetalinkPostDownloadHandlerTest.cc * src/PostDownloadHandler.{h, cc} * src/DownloadHandlerConstants.{h, cc} * src/RequestGroup.cc * src/HttpResponseCommand.cc * src/FtpNegotiationCommand.cc * src/SingleFileDownloadContext.{h, cc} * src/RequestGroup.h * src/RequestGroupCriteria.h * src/ContentTypeRequestGroupCriteria.h Added 'mem' option value for --follow-metalink, --follow-torrent. If it is give, metalink/torrent file is not written to the disk, but just is kept in memory. Parsing is occurred on memory. * src/MetalinkHelper.{h, cc} * src/MetalinkProcessor.h * src/Xml2MetalinkProcessor.{h, cc} * test/Xml2MetalinkProcessorTest.cc * src/DownloadHandlerFactory.{h, cc} * test/DownloadHandlerFactoryTest.cc * src/PreDownloadHandler.{h, cc} * src/OptionHandlerFactory.cc * src/DefaultBtContext.{h, cc} * test/DefaultBtContextTest.cc * src/version_usage.cc * src/Metalink2RequestGroup.{h, cc} * src/RequestGroup.{h, cc} * src/a2functional.h * test/a2functionalTest.cc * src/MemoryBufferPreDownloadHandler.{h, cc} * src/OptionHandlerImpl.h * src/prefs.h * src/Util.{h, cc} * test/UtilTest.cc Keep DownloadResult rather than RequestGroup after downloads to reduce memory usage. * src/RequestGroupMan.{h, cc} * src/DownloadEngine.cc * src/BtDependency.{h, cc}: Changed the type of dependee from WeakHandle to SharedHandle because WeakHandle could be null. * src/RequestGroup.{h, cc} * src/DownloadEngineFactory.cc * src/DownloadResult.h Set totalLength after download finished * src/UnknownLengthPieceStorage.{h, cc} Keep torrent file specified in metalink in memory. * src/Metalink2RequestGroup.cc * src/BtDependency.cc * src/TrueRequestGroupCriteria.h Fixed the bug: seekg is used where seekp should be used. * src/ByteArrayDiskWriter.cc * test/ByteArraydiskWriterTest.cc
2007-11-27 12:27:10 +00:00
}
void reportDownloadFinished();
const std::vector<std::string>& getAcceptTypes() const
2009-05-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> Implemented getter methods in header files to give them more chance of optimization. Return const reference for SharadHandle if possible. * src/AbstractAuthResolver.cc * src/AbstractAuthResolver.h * src/AbstractBtMessage.cc * src/AbstractBtMessage.h * src/AbstractSingleDiskAdaptor.cc * src/AbstractSingleDiskAdaptor.h * src/AsyncNameResolver.cc * src/AsyncNameResolver.h * src/BNode.cc * src/BNode.h * src/BitfieldMan.cc * src/BitfieldMan.h * src/BtAbortOutstandingRequestEvent.h * src/BtExtendedMessage.cc * src/BtExtendedMessage.h * src/BtSeederStateChoke.cc * src/BtSeederStateChoke.h * src/Cookie.cc * src/Cookie.h * src/DHTBucket.cc * src/DHTBucket.h * src/DHTConnectionImpl.cc * src/DHTConnectionImpl.h * src/DHTFindNodeReplyMessage.cc * src/DHTFindNodeReplyMessage.h * src/DHTGetPeersReplyMessage.cc * src/DHTGetPeersReplyMessage.h * src/DHTInteractionCommand.cc * src/DHTMessage.cc * src/DHTMessage.h * src/DHTMessageDispatcherImpl.cc * src/DHTMessageEntry.cc * src/DHTMessageReceiver.cc * src/DHTMessageReceiver.h * src/DHTMessageTrackerEntry.cc * src/DHTMessageTrackerEntry.h * src/DHTPeerAnnounceEntry.cc * src/DHTPeerAnnounceEntry.h * src/DHTPeerLookupTask.cc * src/DHTPeerLookupTask.h * src/DHTRoutingTableDeserializer.cc * src/DHTRoutingTableDeserializer.h * src/DefaultBtAnnounce.cc * src/DefaultBtAnnounce.h * src/DefaultBtMessageDispatcher.cc * src/DefaultBtMessageDispatcher.h * src/DefaultBtRequestFactory.cc * src/DefaultBtRequestFactory.h * src/DiskAdaptor.cc * src/DiskAdaptor.h * src/DownloadContext.cc * src/DownloadContext.h * src/DownloadEngine.cc * src/DownloadEngine.h * src/EpollEventPoll.cc * src/EpollEventPoll.h * src/FtpConnection.cc * src/FtpConnection.h * src/HttpConnection.cc * src/HttpConnection.h * src/HttpHeader.cc * src/HttpHeader.h * src/HttpRequest.cc * src/HttpRequest.h * src/HttpResponse.cc * src/HttpResponse.h * src/LibsslTLSContext.cc * src/LibsslTLSContext.h * src/MSEHandshake.cc * src/MSEHandshake.h * src/MetalinkEntry.cc * src/MetalinkEntry.h * src/MetalinkParserController.cc * src/MetalinkParserController.h * src/MetalinkParserStateMachine.cc * src/MetalinkParserStateMachine.h * src/MultiDiskAdaptor.cc * src/MultiDiskAdaptor.h * src/NetrcAuthResolver.cc * src/NetrcAuthResolver.h * src/Peer.cc * src/Peer.h * src/PeerSessionResource.cc * src/PeerSessionResource.h * src/Piece.cc * src/Piece.h * src/PieceStatMan.cc * src/PieceStatMan.h * src/Request.cc * src/Request.h * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/RequestGroupMan.h * src/RequestSlot.cc * src/RequestSlot.h * src/SegmentMan.cc * src/SegmentMan.h * src/SelectEventPoll.cc * src/SelectEventPoll.h * src/ServerStat.cc * src/ServerStat.h * src/Signature.cc * src/Signature.h * src/URIResult.cc * src/URIResult.h * src/UTPexExtensionMessage.cc * src/UTPexExtensionMessage.h
2009-05-29 12:12:22 +00:00
{
return acceptTypes_;
2009-05-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> Implemented getter methods in header files to give them more chance of optimization. Return const reference for SharadHandle if possible. * src/AbstractAuthResolver.cc * src/AbstractAuthResolver.h * src/AbstractBtMessage.cc * src/AbstractBtMessage.h * src/AbstractSingleDiskAdaptor.cc * src/AbstractSingleDiskAdaptor.h * src/AsyncNameResolver.cc * src/AsyncNameResolver.h * src/BNode.cc * src/BNode.h * src/BitfieldMan.cc * src/BitfieldMan.h * src/BtAbortOutstandingRequestEvent.h * src/BtExtendedMessage.cc * src/BtExtendedMessage.h * src/BtSeederStateChoke.cc * src/BtSeederStateChoke.h * src/Cookie.cc * src/Cookie.h * src/DHTBucket.cc * src/DHTBucket.h * src/DHTConnectionImpl.cc * src/DHTConnectionImpl.h * src/DHTFindNodeReplyMessage.cc * src/DHTFindNodeReplyMessage.h * src/DHTGetPeersReplyMessage.cc * src/DHTGetPeersReplyMessage.h * src/DHTInteractionCommand.cc * src/DHTMessage.cc * src/DHTMessage.h * src/DHTMessageDispatcherImpl.cc * src/DHTMessageEntry.cc * src/DHTMessageReceiver.cc * src/DHTMessageReceiver.h * src/DHTMessageTrackerEntry.cc * src/DHTMessageTrackerEntry.h * src/DHTPeerAnnounceEntry.cc * src/DHTPeerAnnounceEntry.h * src/DHTPeerLookupTask.cc * src/DHTPeerLookupTask.h * src/DHTRoutingTableDeserializer.cc * src/DHTRoutingTableDeserializer.h * src/DefaultBtAnnounce.cc * src/DefaultBtAnnounce.h * src/DefaultBtMessageDispatcher.cc * src/DefaultBtMessageDispatcher.h * src/DefaultBtRequestFactory.cc * src/DefaultBtRequestFactory.h * src/DiskAdaptor.cc * src/DiskAdaptor.h * src/DownloadContext.cc * src/DownloadContext.h * src/DownloadEngine.cc * src/DownloadEngine.h * src/EpollEventPoll.cc * src/EpollEventPoll.h * src/FtpConnection.cc * src/FtpConnection.h * src/HttpConnection.cc * src/HttpConnection.h * src/HttpHeader.cc * src/HttpHeader.h * src/HttpRequest.cc * src/HttpRequest.h * src/HttpResponse.cc * src/HttpResponse.h * src/LibsslTLSContext.cc * src/LibsslTLSContext.h * src/MSEHandshake.cc * src/MSEHandshake.h * src/MetalinkEntry.cc * src/MetalinkEntry.h * src/MetalinkParserController.cc * src/MetalinkParserController.h * src/MetalinkParserStateMachine.cc * src/MetalinkParserStateMachine.h * src/MultiDiskAdaptor.cc * src/MultiDiskAdaptor.h * src/NetrcAuthResolver.cc * src/NetrcAuthResolver.h * src/Peer.cc * src/Peer.h * src/PeerSessionResource.cc * src/PeerSessionResource.h * src/Piece.cc * src/Piece.h * src/PieceStatMan.cc * src/PieceStatMan.h * src/Request.cc * src/Request.h * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/RequestGroupMan.h * src/RequestSlot.cc * src/RequestSlot.h * src/SegmentMan.cc * src/SegmentMan.h * src/SelectEventPoll.cc * src/SelectEventPoll.h * src/ServerStat.cc * src/ServerStat.h * src/Signature.cc * src/Signature.h * src/URIResult.cc * src/URIResult.h * src/UTPexExtensionMessage.cc * src/UTPexExtensionMessage.h
2009-05-29 12:12:22 +00:00
}
void addAcceptType(const std::string& type);
template<typename InputIterator>
void addAcceptType(InputIterator first, InputIterator last)
{
for(; first != last; ++first) {
if(std::find(acceptTypes_.begin(), acceptTypes_.end(), *first) ==
acceptTypes_.end()) {
acceptTypes_.push_back(*first);
}
}
}
void removeAcceptType(const std::string& type);
void setURISelector(const SharedHandle<URISelector>& uriSelector);
2009-06-24 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> Added experimental support of WEB-Seeding for multi-file torrent. Due to fundamental changes in file handling in HTTP/FTP code, many functions are not working: PeerStat, ServerHost, proxy..etc * src/AbstractCommand.cc * src/AbstractCommand.h * src/BitfieldMan.cc * src/BitfieldMan.h * src/CreateRequestCommand.cc * src/CreateRequestCommand.h * src/DefaultPieceStorage.cc * src/DefaultPieceStorage.h * src/DownloadCommand.cc * src/DownloadCommand.h * src/DownloadContext.cc * src/DownloadContext.h * src/FileEntry.cc * src/FileEntry.h * src/FtpDownloadCommand.cc * src/FtpDownloadCommand.h * src/FtpFinishDownloadCommand.cc * src/FtpFinishDownloadCommand.h * src/FtpInitiateConnectionCommand.cc * src/FtpInitiateConnectionCommand.h * src/FtpNegotiationCommand.cc * src/FtpNegotiationCommand.h * src/FtpTunnelResponseCommand.cc * src/HttpDownloadCommand.cc * src/HttpDownloadCommand.h * src/HttpInitiateConnectionCommand.cc * src/HttpInitiateConnectionCommand.h * src/HttpProxyResponseCommand.cc * src/HttpRequest.cc * src/HttpRequest.h * src/HttpRequestCommand.cc * src/HttpRequestCommand.h * src/HttpResponseCommand.cc * src/HttpResponseCommand.h * src/HttpSkipResponseCommand.cc * src/HttpSkipResponseCommand.h * src/InitiateConnectionCommand.cc * src/InitiateConnectionCommand.h * src/InitiateConnectionCommandFactory.cc * src/InitiateConnectionCommandFactory.h * src/Makefile.am * src/PieceStorage.h * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/SegmentMan.cc * src/SegmentMan.h * src/SingleFileDownloadContext.h * src/StreamFileAllocationEntry.cc * src/TrackerWatcherCommand.cc * src/UnknownLengthPieceStorage.cc * src/UnknownLengthPieceStorage.h * src/array_fun.h * src/bitfield.h * src/download_helper.cc * test/DownloadContextTest.cc * test/Makefile.am * test/MockDownloadContext.h
2009-06-23 15:35:45 +00:00
const SharedHandle<URISelector>& getURISelector() const
{
return uriSelector_;
2009-06-24 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> Added experimental support of WEB-Seeding for multi-file torrent. Due to fundamental changes in file handling in HTTP/FTP code, many functions are not working: PeerStat, ServerHost, proxy..etc * src/AbstractCommand.cc * src/AbstractCommand.h * src/BitfieldMan.cc * src/BitfieldMan.h * src/CreateRequestCommand.cc * src/CreateRequestCommand.h * src/DefaultPieceStorage.cc * src/DefaultPieceStorage.h * src/DownloadCommand.cc * src/DownloadCommand.h * src/DownloadContext.cc * src/DownloadContext.h * src/FileEntry.cc * src/FileEntry.h * src/FtpDownloadCommand.cc * src/FtpDownloadCommand.h * src/FtpFinishDownloadCommand.cc * src/FtpFinishDownloadCommand.h * src/FtpInitiateConnectionCommand.cc * src/FtpInitiateConnectionCommand.h * src/FtpNegotiationCommand.cc * src/FtpNegotiationCommand.h * src/FtpTunnelResponseCommand.cc * src/HttpDownloadCommand.cc * src/HttpDownloadCommand.h * src/HttpInitiateConnectionCommand.cc * src/HttpInitiateConnectionCommand.h * src/HttpProxyResponseCommand.cc * src/HttpRequest.cc * src/HttpRequest.h * src/HttpRequestCommand.cc * src/HttpRequestCommand.h * src/HttpResponseCommand.cc * src/HttpResponseCommand.h * src/HttpSkipResponseCommand.cc * src/HttpSkipResponseCommand.h * src/InitiateConnectionCommand.cc * src/InitiateConnectionCommand.h * src/InitiateConnectionCommandFactory.cc * src/InitiateConnectionCommandFactory.h * src/Makefile.am * src/PieceStorage.h * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/SegmentMan.cc * src/SegmentMan.h * src/SingleFileDownloadContext.h * src/StreamFileAllocationEntry.cc * src/TrackerWatcherCommand.cc * src/UnknownLengthPieceStorage.cc * src/UnknownLengthPieceStorage.h * src/array_fun.h * src/bitfield.h * src/download_helper.cc * test/DownloadContextTest.cc * test/Makefile.am * test/MockDownloadContext.h
2009-06-23 15:35:45 +00:00
}
void applyLastModifiedTimeToLocalFiles();
void updateLastModifiedTime(const Time& time);
void increaseAndValidateFileNotFoundCount();
// Just set inMemoryDownload flag true.
void markInMemoryDownload();
// Returns inMemoryDownload flag.
2009-05-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> Implemented getter methods in header files to give them more chance of optimization. Return const reference for SharadHandle if possible. * src/AbstractAuthResolver.cc * src/AbstractAuthResolver.h * src/AbstractBtMessage.cc * src/AbstractBtMessage.h * src/AbstractSingleDiskAdaptor.cc * src/AbstractSingleDiskAdaptor.h * src/AsyncNameResolver.cc * src/AsyncNameResolver.h * src/BNode.cc * src/BNode.h * src/BitfieldMan.cc * src/BitfieldMan.h * src/BtAbortOutstandingRequestEvent.h * src/BtExtendedMessage.cc * src/BtExtendedMessage.h * src/BtSeederStateChoke.cc * src/BtSeederStateChoke.h * src/Cookie.cc * src/Cookie.h * src/DHTBucket.cc * src/DHTBucket.h * src/DHTConnectionImpl.cc * src/DHTConnectionImpl.h * src/DHTFindNodeReplyMessage.cc * src/DHTFindNodeReplyMessage.h * src/DHTGetPeersReplyMessage.cc * src/DHTGetPeersReplyMessage.h * src/DHTInteractionCommand.cc * src/DHTMessage.cc * src/DHTMessage.h * src/DHTMessageDispatcherImpl.cc * src/DHTMessageEntry.cc * src/DHTMessageReceiver.cc * src/DHTMessageReceiver.h * src/DHTMessageTrackerEntry.cc * src/DHTMessageTrackerEntry.h * src/DHTPeerAnnounceEntry.cc * src/DHTPeerAnnounceEntry.h * src/DHTPeerLookupTask.cc * src/DHTPeerLookupTask.h * src/DHTRoutingTableDeserializer.cc * src/DHTRoutingTableDeserializer.h * src/DefaultBtAnnounce.cc * src/DefaultBtAnnounce.h * src/DefaultBtMessageDispatcher.cc * src/DefaultBtMessageDispatcher.h * src/DefaultBtRequestFactory.cc * src/DefaultBtRequestFactory.h * src/DiskAdaptor.cc * src/DiskAdaptor.h * src/DownloadContext.cc * src/DownloadContext.h * src/DownloadEngine.cc * src/DownloadEngine.h * src/EpollEventPoll.cc * src/EpollEventPoll.h * src/FtpConnection.cc * src/FtpConnection.h * src/HttpConnection.cc * src/HttpConnection.h * src/HttpHeader.cc * src/HttpHeader.h * src/HttpRequest.cc * src/HttpRequest.h * src/HttpResponse.cc * src/HttpResponse.h * src/LibsslTLSContext.cc * src/LibsslTLSContext.h * src/MSEHandshake.cc * src/MSEHandshake.h * src/MetalinkEntry.cc * src/MetalinkEntry.h * src/MetalinkParserController.cc * src/MetalinkParserController.h * src/MetalinkParserStateMachine.cc * src/MetalinkParserStateMachine.h * src/MultiDiskAdaptor.cc * src/MultiDiskAdaptor.h * src/NetrcAuthResolver.cc * src/NetrcAuthResolver.h * src/Peer.cc * src/Peer.h * src/PeerSessionResource.cc * src/PeerSessionResource.h * src/Piece.cc * src/Piece.h * src/PieceStatMan.cc * src/PieceStatMan.h * src/Request.cc * src/Request.h * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/RequestGroupMan.h * src/RequestSlot.cc * src/RequestSlot.h * src/SegmentMan.cc * src/SegmentMan.h * src/SelectEventPoll.cc * src/SelectEventPoll.h * src/ServerStat.cc * src/ServerStat.h * src/Signature.cc * src/Signature.h * src/URIResult.cc * src/URIResult.h * src/UTPexExtensionMessage.cc * src/UTPexExtensionMessage.h
2009-05-29 12:12:22 +00:00
bool inMemoryDownload() const
{
return inMemoryDownload_;
2009-05-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> Implemented getter methods in header files to give them more chance of optimization. Return const reference for SharadHandle if possible. * src/AbstractAuthResolver.cc * src/AbstractAuthResolver.h * src/AbstractBtMessage.cc * src/AbstractBtMessage.h * src/AbstractSingleDiskAdaptor.cc * src/AbstractSingleDiskAdaptor.h * src/AsyncNameResolver.cc * src/AsyncNameResolver.h * src/BNode.cc * src/BNode.h * src/BitfieldMan.cc * src/BitfieldMan.h * src/BtAbortOutstandingRequestEvent.h * src/BtExtendedMessage.cc * src/BtExtendedMessage.h * src/BtSeederStateChoke.cc * src/BtSeederStateChoke.h * src/Cookie.cc * src/Cookie.h * src/DHTBucket.cc * src/DHTBucket.h * src/DHTConnectionImpl.cc * src/DHTConnectionImpl.h * src/DHTFindNodeReplyMessage.cc * src/DHTFindNodeReplyMessage.h * src/DHTGetPeersReplyMessage.cc * src/DHTGetPeersReplyMessage.h * src/DHTInteractionCommand.cc * src/DHTMessage.cc * src/DHTMessage.h * src/DHTMessageDispatcherImpl.cc * src/DHTMessageEntry.cc * src/DHTMessageReceiver.cc * src/DHTMessageReceiver.h * src/DHTMessageTrackerEntry.cc * src/DHTMessageTrackerEntry.h * src/DHTPeerAnnounceEntry.cc * src/DHTPeerAnnounceEntry.h * src/DHTPeerLookupTask.cc * src/DHTPeerLookupTask.h * src/DHTRoutingTableDeserializer.cc * src/DHTRoutingTableDeserializer.h * src/DefaultBtAnnounce.cc * src/DefaultBtAnnounce.h * src/DefaultBtMessageDispatcher.cc * src/DefaultBtMessageDispatcher.h * src/DefaultBtRequestFactory.cc * src/DefaultBtRequestFactory.h * src/DiskAdaptor.cc * src/DiskAdaptor.h * src/DownloadContext.cc * src/DownloadContext.h * src/DownloadEngine.cc * src/DownloadEngine.h * src/EpollEventPoll.cc * src/EpollEventPoll.h * src/FtpConnection.cc * src/FtpConnection.h * src/HttpConnection.cc * src/HttpConnection.h * src/HttpHeader.cc * src/HttpHeader.h * src/HttpRequest.cc * src/HttpRequest.h * src/HttpResponse.cc * src/HttpResponse.h * src/LibsslTLSContext.cc * src/LibsslTLSContext.h * src/MSEHandshake.cc * src/MSEHandshake.h * src/MetalinkEntry.cc * src/MetalinkEntry.h * src/MetalinkParserController.cc * src/MetalinkParserController.h * src/MetalinkParserStateMachine.cc * src/MetalinkParserStateMachine.h * src/MultiDiskAdaptor.cc * src/MultiDiskAdaptor.h * src/NetrcAuthResolver.cc * src/NetrcAuthResolver.h * src/Peer.cc * src/Peer.h * src/PeerSessionResource.cc * src/PeerSessionResource.h * src/Piece.cc * src/Piece.h * src/PieceStatMan.cc * src/PieceStatMan.h * src/Request.cc * src/Request.h * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/RequestGroupMan.h * src/RequestSlot.cc * src/RequestSlot.h * src/SegmentMan.cc * src/SegmentMan.h * src/SelectEventPoll.cc * src/SelectEventPoll.h * src/ServerStat.cc * src/ServerStat.h * src/Signature.cc * src/Signature.h * src/URIResult.cc * src/URIResult.h * src/UTPexExtensionMessage.cc * src/UTPexExtensionMessage.h
2009-05-29 12:12:22 +00:00
}
void setTimeout(time_t timeout);
2009-05-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> Implemented getter methods in header files to give them more chance of optimization. Return const reference for SharadHandle if possible. * src/AbstractAuthResolver.cc * src/AbstractAuthResolver.h * src/AbstractBtMessage.cc * src/AbstractBtMessage.h * src/AbstractSingleDiskAdaptor.cc * src/AbstractSingleDiskAdaptor.h * src/AsyncNameResolver.cc * src/AsyncNameResolver.h * src/BNode.cc * src/BNode.h * src/BitfieldMan.cc * src/BitfieldMan.h * src/BtAbortOutstandingRequestEvent.h * src/BtExtendedMessage.cc * src/BtExtendedMessage.h * src/BtSeederStateChoke.cc * src/BtSeederStateChoke.h * src/Cookie.cc * src/Cookie.h * src/DHTBucket.cc * src/DHTBucket.h * src/DHTConnectionImpl.cc * src/DHTConnectionImpl.h * src/DHTFindNodeReplyMessage.cc * src/DHTFindNodeReplyMessage.h * src/DHTGetPeersReplyMessage.cc * src/DHTGetPeersReplyMessage.h * src/DHTInteractionCommand.cc * src/DHTMessage.cc * src/DHTMessage.h * src/DHTMessageDispatcherImpl.cc * src/DHTMessageEntry.cc * src/DHTMessageReceiver.cc * src/DHTMessageReceiver.h * src/DHTMessageTrackerEntry.cc * src/DHTMessageTrackerEntry.h * src/DHTPeerAnnounceEntry.cc * src/DHTPeerAnnounceEntry.h * src/DHTPeerLookupTask.cc * src/DHTPeerLookupTask.h * src/DHTRoutingTableDeserializer.cc * src/DHTRoutingTableDeserializer.h * src/DefaultBtAnnounce.cc * src/DefaultBtAnnounce.h * src/DefaultBtMessageDispatcher.cc * src/DefaultBtMessageDispatcher.h * src/DefaultBtRequestFactory.cc * src/DefaultBtRequestFactory.h * src/DiskAdaptor.cc * src/DiskAdaptor.h * src/DownloadContext.cc * src/DownloadContext.h * src/DownloadEngine.cc * src/DownloadEngine.h * src/EpollEventPoll.cc * src/EpollEventPoll.h * src/FtpConnection.cc * src/FtpConnection.h * src/HttpConnection.cc * src/HttpConnection.h * src/HttpHeader.cc * src/HttpHeader.h * src/HttpRequest.cc * src/HttpRequest.h * src/HttpResponse.cc * src/HttpResponse.h * src/LibsslTLSContext.cc * src/LibsslTLSContext.h * src/MSEHandshake.cc * src/MSEHandshake.h * src/MetalinkEntry.cc * src/MetalinkEntry.h * src/MetalinkParserController.cc * src/MetalinkParserController.h * src/MetalinkParserStateMachine.cc * src/MetalinkParserStateMachine.h * src/MultiDiskAdaptor.cc * src/MultiDiskAdaptor.h * src/NetrcAuthResolver.cc * src/NetrcAuthResolver.h * src/Peer.cc * src/Peer.h * src/PeerSessionResource.cc * src/PeerSessionResource.h * src/Piece.cc * src/Piece.h * src/PieceStatMan.cc * src/PieceStatMan.h * src/Request.cc * src/Request.h * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/RequestGroupMan.h * src/RequestSlot.cc * src/RequestSlot.h * src/SegmentMan.cc * src/SegmentMan.h * src/SelectEventPoll.cc * src/SelectEventPoll.h * src/ServerStat.cc * src/ServerStat.h * src/Signature.cc * src/Signature.h * src/URIResult.cc * src/URIResult.h * src/UTPexExtensionMessage.cc * src/UTPexExtensionMessage.h
2009-05-29 12:12:22 +00:00
time_t getTimeout() const
{
return timeout_;
2009-05-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> Implemented getter methods in header files to give them more chance of optimization. Return const reference for SharadHandle if possible. * src/AbstractAuthResolver.cc * src/AbstractAuthResolver.h * src/AbstractBtMessage.cc * src/AbstractBtMessage.h * src/AbstractSingleDiskAdaptor.cc * src/AbstractSingleDiskAdaptor.h * src/AsyncNameResolver.cc * src/AsyncNameResolver.h * src/BNode.cc * src/BNode.h * src/BitfieldMan.cc * src/BitfieldMan.h * src/BtAbortOutstandingRequestEvent.h * src/BtExtendedMessage.cc * src/BtExtendedMessage.h * src/BtSeederStateChoke.cc * src/BtSeederStateChoke.h * src/Cookie.cc * src/Cookie.h * src/DHTBucket.cc * src/DHTBucket.h * src/DHTConnectionImpl.cc * src/DHTConnectionImpl.h * src/DHTFindNodeReplyMessage.cc * src/DHTFindNodeReplyMessage.h * src/DHTGetPeersReplyMessage.cc * src/DHTGetPeersReplyMessage.h * src/DHTInteractionCommand.cc * src/DHTMessage.cc * src/DHTMessage.h * src/DHTMessageDispatcherImpl.cc * src/DHTMessageEntry.cc * src/DHTMessageReceiver.cc * src/DHTMessageReceiver.h * src/DHTMessageTrackerEntry.cc * src/DHTMessageTrackerEntry.h * src/DHTPeerAnnounceEntry.cc * src/DHTPeerAnnounceEntry.h * src/DHTPeerLookupTask.cc * src/DHTPeerLookupTask.h * src/DHTRoutingTableDeserializer.cc * src/DHTRoutingTableDeserializer.h * src/DefaultBtAnnounce.cc * src/DefaultBtAnnounce.h * src/DefaultBtMessageDispatcher.cc * src/DefaultBtMessageDispatcher.h * src/DefaultBtRequestFactory.cc * src/DefaultBtRequestFactory.h * src/DiskAdaptor.cc * src/DiskAdaptor.h * src/DownloadContext.cc * src/DownloadContext.h * src/DownloadEngine.cc * src/DownloadEngine.h * src/EpollEventPoll.cc * src/EpollEventPoll.h * src/FtpConnection.cc * src/FtpConnection.h * src/HttpConnection.cc * src/HttpConnection.h * src/HttpHeader.cc * src/HttpHeader.h * src/HttpRequest.cc * src/HttpRequest.h * src/HttpResponse.cc * src/HttpResponse.h * src/LibsslTLSContext.cc * src/LibsslTLSContext.h * src/MSEHandshake.cc * src/MSEHandshake.h * src/MetalinkEntry.cc * src/MetalinkEntry.h * src/MetalinkParserController.cc * src/MetalinkParserController.h * src/MetalinkParserStateMachine.cc * src/MetalinkParserStateMachine.h * src/MultiDiskAdaptor.cc * src/MultiDiskAdaptor.h * src/NetrcAuthResolver.cc * src/NetrcAuthResolver.h * src/Peer.cc * src/Peer.h * src/PeerSessionResource.cc * src/PeerSessionResource.h * src/Piece.cc * src/Piece.h * src/PieceStatMan.cc * src/PieceStatMan.h * src/Request.cc * src/Request.h * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/RequestGroupMan.h * src/RequestSlot.cc * src/RequestSlot.h * src/SegmentMan.cc * src/SegmentMan.h * src/SelectEventPoll.cc * src/SelectEventPoll.h * src/ServerStat.cc * src/ServerStat.h * src/Signature.cc * src/Signature.h * src/URIResult.cc * src/URIResult.h * src/UTPexExtensionMessage.cc * src/UTPexExtensionMessage.h
2009-05-29 12:12:22 +00:00
}
// Returns true if current download speed exceeds
// maxDownloadSpeedLimit_. Always returns false if
// maxDownloadSpeedLimit_ == 0. Otherwise returns false.
bool doesDownloadSpeedExceed();
// Returns true if current upload speed exceeds
// maxUploadSpeedLimit_. Always returns false if
// maxUploadSpeedLimit_ == 0. Otherwise returns false.
bool doesUploadSpeedExceed();
int getMaxDownloadSpeedLimit() const
{
return maxDownloadSpeedLimit_;
}
void setMaxDownloadSpeedLimit(int speed)
{
maxDownloadSpeedLimit_ = speed;
}
int getMaxUploadSpeedLimit() const
{
return maxUploadSpeedLimit_;
}
void setMaxUploadSpeedLimit(int speed)
{
maxUploadSpeedLimit_ = speed;
}
void setLastErrorCode(error_code::Value code)
{
lastErrorCode_ = code;
}
2009-06-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net> Removed _uris from RequestGroup. All functions that refer to _uris were moved to FileEntry. Exit status code are now defined in DownloadResultCode.h. * src/AbstractCommand.cc * src/AdaptiveURISelector.cc * src/AdaptiveURISelector.h * src/AutoSaveCommand.cc * src/BtPostDownloadHandler.cc * src/CheckIntegrityDispatcherCommand.cc * src/CookieStorage.cc * src/DHTAutoSaveCommand.cc * src/DHTBucketRefreshCommand.cc * src/DHTEntryPointNameResolveCommand.cc * src/DHTInteractionCommand.cc * src/DHTPeerAnnounceCommand.cc * src/DHTTokenUpdateCommand.cc * src/DlAbortEx.h * src/DlRetryEx.h * src/DownloadCommand.cc * src/DownloadContext.h * src/DownloadFailureException.h * src/DownloadResult.h * src/DownloadResultCode.h * src/FeedbackURISelector.cc * src/FeedbackURISelector.h * src/FileEntry.cc * src/FileEntry.h * src/FtpNegotiationCommand.cc * src/HttpListenCommand.cc * src/HttpResponseCommand.cc * src/HttpServerResponseCommand.cc * src/HttpSkipResponseCommand.cc * src/InOrderURISelector.cc * src/InOrderURISelector.h * src/Makefile.am * src/Makefile.in * src/Metalink2RequestGroup.cc * src/MultiUrlRequestInfo.cc * src/MultiUrlRequestInfo.h * src/OptionHandlerFactory.cc * src/PeerListenCommand.cc * src/RecoverableException.h * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/RequestGroupMan.h * src/TimedHaltCommand.cc * src/TrackerWatcherCommand.cc * src/URIResult.cc * src/URIResult.h * src/URISelector.h * src/XmlRpcMethodImpl.cc * src/bittorrent_helper.cc * src/bittorrent_helper.h * src/download_helper.cc * src/main.cc * src/option_processing.cc * test/BtDependencyTest.cc * test/BtPostDownloadHandlerTest.cc * test/CookieStorageTest.cc * test/DefaultBtMessageDispatcherTest.cc * test/DownloadHandlerFactoryTest.cc * test/DownloadHelperTest.cc * test/FeedbackURISelectorTest.cc * test/FileEntryTest.cc * test/InOrderURISelectorTest.cc * test/Metalink2RequestGroupTest.cc * test/MetalinkPostDownloadHandlerTest.cc * test/RequestGroupManTest.cc * test/RequestGroupTest.cc * test/XmlRpcMethodTest.cc
2009-06-29 08:42:58 +00:00
error_code::Value getLastErrorCode() const
{
return lastErrorCode_;
}
void saveControlFile() const;
void removeControlFile() const;
void enableSaveControlFile() { saveControlFile_ = true; }
void disableSaveControlFile() { saveControlFile_ = false; }
template<typename InputIterator>
void followedBy(InputIterator groupFirst, InputIterator groupLast)
{
followedByGIDs_.clear();
for(; groupFirst != groupLast; ++groupFirst) {
followedByGIDs_.push_back((*groupFirst)->getGID());
}
}
const std::vector<a2_gid_t>& followedBy() const
{
return followedByGIDs_;
}
void belongsTo(a2_gid_t gid)
{
belongsToGID_ = gid;
}
a2_gid_t belongsTo() const
{
return belongsToGID_;
}
void setRequestGroupMan(RequestGroupMan* requestGroupMan)
{
requestGroupMan_ = requestGroupMan;
}
int getResumeFailureCount() const
{
return resumeFailureCount_;
}
void increaseResumeFailureCount()
{
++resumeFailureCount_;
}
bool p2pInvolved() const;
void setMetadataInfo(const SharedHandle<MetadataInfo>& info)
{
metadataInfo_ = info;
}
const SharedHandle<MetadataInfo>& getMetadataInfo() const
{
return metadataInfo_;
}
static void resetGIDCounter() { gidCounter_ = 0; }
static a2_gid_t newGID();
2007-05-20 13:57:56 +00:00
};
} // namespace aria2
2007-05-20 13:57:56 +00:00
#endif // D_REQUEST_GROUP_H