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
|
|
|
|
*
|
|
|
|
* 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_
|
|
|
|
|
|
|
|
#include "common.h"
|
2008-02-08 15:53:45 +00:00
|
|
|
#include "SharedHandle.h"
|
2007-10-11 16:58:24 +00:00
|
|
|
#include "TransferStat.h"
|
2008-02-08 15:53:45 +00:00
|
|
|
#include <string>
|
|
|
|
#include <deque>
|
|
|
|
|
|
|
|
namespace aria2 {
|
2007-05-31 15:56:20 +00:00
|
|
|
|
2007-05-20 13:57:56 +00:00
|
|
|
class DownloadEngine;
|
2007-10-11 16:58:24 +00:00
|
|
|
class SegmentMan;
|
|
|
|
class SegmentManFactory;
|
|
|
|
class Command;
|
|
|
|
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;
|
2007-10-11 16:58:24 +00:00
|
|
|
class PostDownloadHandler;
|
|
|
|
class DiskWriterFactory;
|
|
|
|
class Option;
|
|
|
|
class Logger;
|
|
|
|
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;
|
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 DownloadResult;
|
2007-12-12 13:53:33 +00:00
|
|
|
class ServerHost;
|
2007-05-20 13:57:56 +00:00
|
|
|
|
|
|
|
class RequestGroup {
|
|
|
|
private:
|
2007-10-11 16:58:24 +00:00
|
|
|
static int32_t _gidCounter;
|
|
|
|
|
2007-06-10 15:22:36 +00:00
|
|
|
int32_t _gid;
|
2007-10-11 16:58:24 +00:00
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
std::deque<std::string> _uris;
|
|
|
|
std::deque<std::string> _spentUris;
|
2007-10-11 16:58:24 +00:00
|
|
|
|
2008-03-09 12:24:01 +00:00
|
|
|
unsigned int _numConcurrentCommand;
|
2007-10-11 16:58:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This is the number of connections used in streaming protocol(http/ftp)
|
|
|
|
*/
|
2008-03-09 12:24:01 +00:00
|
|
|
unsigned int _numStreamConnection;
|
2007-10-11 16:58:24 +00:00
|
|
|
|
2008-03-09 12:24:01 +00:00
|
|
|
unsigned int _numCommand;
|
2007-10-11 16:58:24 +00:00
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
SharedHandle<SegmentMan> _segmentMan;
|
|
|
|
SharedHandle<SegmentManFactory> _segmentManFactory;
|
2007-10-11 16:58:24 +00:00
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
SharedHandle<DownloadContext> _downloadContext;
|
2007-10-11 16:58:24 +00:00
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
SharedHandle<PieceStorage> _pieceStorage;
|
2007-10-11 16:58:24 +00:00
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
SharedHandle<BtProgressInfoFile> _progressInfoFile;
|
2007-10-11 16:58:24 +00:00
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
SharedHandle<DiskWriterFactory> _diskWriterFactory;
|
2007-10-11 16:58:24 +00:00
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
SharedHandle<Dependency> _dependency;
|
2007-10-11 16:58:24 +00:00
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
std::deque<SharedHandle<ServerHost> > _serverHosts;
|
2007-12-12 13:53:33 +00:00
|
|
|
|
2007-10-11 16:58:24 +00:00
|
|
|
bool _fileAllocationEnabled;
|
|
|
|
|
|
|
|
bool _preLocalFileCheckEnabled;
|
|
|
|
|
|
|
|
bool _haltRequested;
|
|
|
|
|
2007-12-07 13:33:59 +00:00
|
|
|
bool _forceHaltRequested;
|
|
|
|
|
2007-12-12 13:53:33 +00:00
|
|
|
bool _singleHostMultiConnectionEnabled;
|
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
std::deque<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
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
std::deque<SharedHandle<PostDownloadHandler> > _postDownloadHandlers;
|
2007-10-11 16:58:24 +00:00
|
|
|
|
2008-04-25 17:44:03 +00:00
|
|
|
std::deque<std::string> _acceptFeatures;
|
|
|
|
|
2008-05-05 08:25:41 +00:00
|
|
|
std::deque<std::string> _acceptTypes;
|
|
|
|
|
2007-05-20 13:57:56 +00:00
|
|
|
const Option* _option;
|
2007-10-11 16:58:24 +00:00
|
|
|
|
2008-04-26 05:58:49 +00:00
|
|
|
Logger* _logger;
|
2007-05-20 13:57:56 +00:00
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
void validateFilename(const std::string& expectedFilename,
|
|
|
|
const std::string& actualFilename) const;
|
2007-05-20 13:57:56 +00:00
|
|
|
|
2008-03-09 12:24:01 +00:00
|
|
|
void validateTotalLength(uint64_t expectedTotalLength,
|
|
|
|
uint64_t actualTotalLength) 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();
|
|
|
|
|
2007-10-11 16:58:24 +00:00
|
|
|
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();
|
|
|
|
|
2007-05-20 13:57:56 +00:00
|
|
|
public:
|
2008-02-08 15:53:45 +00:00
|
|
|
RequestGroup(const Option* option, const std::deque<std::string>& uris);
|
2007-05-20 13:57:56 +00:00
|
|
|
|
2007-10-11 16:58:24 +00:00
|
|
|
~RequestGroup();
|
2007-05-20 13:57:56 +00:00
|
|
|
/**
|
|
|
|
* Reinitializes SegmentMan based on current property values and
|
|
|
|
* returns new one.
|
|
|
|
*/
|
2008-02-08 15:53:45 +00:00
|
|
|
SharedHandle<SegmentMan> initSegmentMan();
|
2007-05-20 13:57:56 +00:00
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
SharedHandle<SegmentMan> getSegmentMan() const;
|
2007-10-11 16:58:24 +00:00
|
|
|
|
2008-05-11 09:36:39 +00:00
|
|
|
void createInitialCommand(std::deque<Command*>& commands,
|
|
|
|
DownloadEngine* e);
|
2007-05-20 13:57:56 +00:00
|
|
|
|
2008-05-11 09:36:39 +00:00
|
|
|
void createNextCommandWithAdj(std::deque<Command*>& commands,
|
|
|
|
DownloadEngine* e, int numAdj);
|
2007-06-03 14:24:37 +00:00
|
|
|
|
2008-05-11 09:36:39 +00:00
|
|
|
void createNextCommand(std::deque<Command*>& commands,
|
|
|
|
DownloadEngine* e, unsigned int numCommand,
|
|
|
|
const std::string& method = "GET");
|
2007-05-20 13:57:56 +00:00
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
void addURI(const std::string& uri)
|
2007-05-20 13:57:56 +00:00
|
|
|
{
|
|
|
|
_uris.push_back(uri);
|
|
|
|
}
|
|
|
|
|
2007-10-11 16:58:24 +00:00
|
|
|
bool downloadFinished() const;
|
2007-05-20 13:57:56 +00:00
|
|
|
|
2007-10-29 14:06:59 +00:00
|
|
|
bool allDownloadFinished() const;
|
|
|
|
|
2007-10-11 16:58:24 +00:00
|
|
|
void closeFile();
|
2007-05-20 13:57:56 +00:00
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
std::string getFilePath() const;
|
2007-05-20 13:57:56 +00:00
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
std::string getDir() const;
|
2007-07-01 10:40:30 +00:00
|
|
|
|
2008-03-09 12:24:01 +00:00
|
|
|
uint64_t getTotalLength() const;
|
2007-05-20 13:57:56 +00:00
|
|
|
|
2008-03-09 12:24:01 +00:00
|
|
|
uint64_t getCompletedLength() const;
|
2007-05-20 13:57:56 +00:00
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
const std::deque<std::string>& getRemainingUris() const
|
2007-05-20 13:57:56 +00:00
|
|
|
{
|
|
|
|
return _uris;
|
|
|
|
}
|
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
const std::deque<std::string>& getSpentUris() const
|
2007-05-20 13:57:56 +00:00
|
|
|
{
|
|
|
|
return _spentUris;
|
|
|
|
}
|
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
std::deque<std::string> getUris() const;
|
2007-05-20 13:57:56 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Compares expected filename with specified actualFilename.
|
2007-11-18 11:59:42 +00:00
|
|
|
* The expected filename refers to FileEntry::getBasename() of the first
|
|
|
|
* element of DownloadContext::getFileEntries()
|
2007-05-20 13:57:56 +00:00
|
|
|
*/
|
2008-02-08 15:53:45 +00:00
|
|
|
void validateFilename(const std::string& actualFilename) const;
|
2007-05-20 13:57:56 +00:00
|
|
|
|
2008-03-09 12:24:01 +00:00
|
|
|
void validateTotalLength(uint64_t actualTotalLength) const;
|
2007-05-20 13:57:56 +00:00
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
void setSegmentManFactory(const SharedHandle<SegmentManFactory>& segmentManFactory);
|
2007-06-03 14:24:37 +00:00
|
|
|
|
2008-03-09 12:24:01 +00:00
|
|
|
void setNumConcurrentCommand(unsigned int num)
|
2007-06-03 14:24:37 +00:00
|
|
|
{
|
|
|
|
_numConcurrentCommand = num;
|
|
|
|
}
|
2007-06-04 12:52:57 +00:00
|
|
|
|
2007-10-11 16:58:24 +00:00
|
|
|
int32_t getGID() const
|
|
|
|
{
|
|
|
|
return _gid;
|
|
|
|
}
|
|
|
|
|
|
|
|
TransferStat calculateStat();
|
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
SharedHandle<DownloadContext> getDownloadContext() const;
|
2007-10-11 16:58:24 +00:00
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
void setDownloadContext(const SharedHandle<DownloadContext>& downloadContext);
|
2007-10-11 16:58:24 +00:00
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
SharedHandle<PieceStorage> getPieceStorage() const;
|
2007-10-11 16:58:24 +00:00
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
void setPieceStorage(const SharedHandle<PieceStorage>& pieceStorage);
|
2007-10-11 16:58:24 +00:00
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
SharedHandle<BtProgressInfoFile> getProgressInfoFile() const;
|
2007-10-11 16:58:24 +00:00
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
void setProgressInfoFile(const SharedHandle<BtProgressInfoFile>& progressInfoFile);
|
2007-10-11 16:58:24 +00:00
|
|
|
|
|
|
|
void increaseStreamConnection();
|
|
|
|
|
|
|
|
void decreaseStreamConnection();
|
|
|
|
|
2008-03-09 12:24:01 +00:00
|
|
|
unsigned int getNumConnection() const;
|
2007-10-11 16:58:24 +00:00
|
|
|
|
|
|
|
void increaseNumCommand();
|
|
|
|
|
|
|
|
void decreaseNumCommand();
|
|
|
|
|
2008-03-09 12:24:01 +00:00
|
|
|
unsigned int getNumCommand() const
|
2007-10-11 16:58:24 +00:00
|
|
|
{
|
|
|
|
return _numCommand;
|
|
|
|
}
|
|
|
|
|
|
|
|
// TODO is it better to move the following 2 methods to SingleFileDownloadContext?
|
2008-02-08 15:53:45 +00:00
|
|
|
void setDiskWriterFactory(const SharedHandle<DiskWriterFactory>& diskWriterFactory);
|
2007-06-10 15:22:36 +00:00
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
SharedHandle<DiskWriterFactory> getDiskWriterFactory() const;
|
2007-10-11 16:58:24 +00:00
|
|
|
|
|
|
|
void setFileAllocationEnabled(bool f)
|
2007-06-10 15:22:36 +00:00
|
|
|
{
|
2007-10-11 16:58:24 +00:00
|
|
|
_fileAllocationEnabled = f;
|
2007-06-10 15:22:36 +00:00
|
|
|
}
|
|
|
|
|
2007-10-11 16:58:24 +00:00
|
|
|
bool isFileAllocationEnabled() const
|
2007-06-10 15:22:36 +00:00
|
|
|
{
|
2007-10-11 16:58:24 +00:00
|
|
|
return _fileAllocationEnabled;
|
|
|
|
}
|
|
|
|
|
2007-10-29 12:43:45 +00:00
|
|
|
bool needsFileAllocation() const;
|
|
|
|
|
2007-10-11 16:58:24 +00:00
|
|
|
/**
|
|
|
|
* 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-10 15:22:36 +00:00
|
|
|
}
|
2007-06-30 09:52:39 +00:00
|
|
|
|
2007-10-11 16:58:24 +00:00
|
|
|
bool isPreLocalFileCheckEnabled() const
|
2007-06-30 09:52:39 +00:00
|
|
|
{
|
2007-10-11 16:58:24 +00:00
|
|
|
return _preLocalFileCheckEnabled;
|
2007-06-30 09:52:39 +00:00
|
|
|
}
|
2007-07-01 14:19:15 +00:00
|
|
|
|
2007-10-11 16:58:24 +00:00
|
|
|
void setHaltRequested(bool f);
|
|
|
|
|
2007-12-07 13:33:59 +00:00
|
|
|
void setForceHaltRequested(bool f);
|
|
|
|
|
2007-10-11 16:58:24 +00:00
|
|
|
bool isHaltRequested() const
|
2007-07-01 14:19:15 +00:00
|
|
|
{
|
2007-10-11 16:58:24 +00:00
|
|
|
return _haltRequested;
|
2007-07-01 14:19:15 +00:00
|
|
|
}
|
2007-08-28 15:46:49 +00:00
|
|
|
|
2007-12-07 13:33:59 +00:00
|
|
|
bool isForceHaltRequested() const
|
|
|
|
{
|
|
|
|
return _forceHaltRequested;
|
|
|
|
}
|
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
void dependsOn(const SharedHandle<Dependency>& dep);
|
2007-10-11 16:58:24 +00:00
|
|
|
|
|
|
|
bool isDependencyResolved();
|
|
|
|
|
|
|
|
void releaseRuntimeResource();
|
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
std::deque<SharedHandle<RequestGroup> > postDownloadProcessing();
|
2007-10-11 16:58:24 +00:00
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
void addPostDownloadHandler(const SharedHandle<PostDownloadHandler>& handler);
|
2007-10-11 16:58:24 +00:00
|
|
|
|
|
|
|
void clearPostDowloadHandler();
|
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();
|
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
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 clearPreDowloadHandler();
|
|
|
|
|
2008-05-11 09:36:39 +00:00
|
|
|
void processCheckIntegrityEntry(std::deque<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
|
|
|
|
|
|
|
void initPieceStorage();
|
|
|
|
|
|
|
|
bool downloadFinishedByFileLength();
|
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
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
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
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
|
|
|
|
|
|
|
const Option* getOption() const
|
|
|
|
{
|
|
|
|
return _option;
|
|
|
|
}
|
2007-12-12 13:53:33 +00:00
|
|
|
|
|
|
|
bool isSingleHostMultiConnectionEnabled() const
|
|
|
|
{
|
|
|
|
return _singleHostMultiConnectionEnabled;
|
|
|
|
}
|
|
|
|
|
|
|
|
void setSingleHostMultiConnectionEnabled(bool f)
|
|
|
|
{
|
|
|
|
_singleHostMultiConnectionEnabled = f;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Registers given ServerHost.
|
|
|
|
*/
|
2008-02-08 15:53:45 +00:00
|
|
|
void registerServerHost(const SharedHandle<ServerHost>& serverHost);
|
2007-12-12 13:53:33 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns ServerHost whose cuid is given cuid. If it is not found, returns
|
|
|
|
* 0.
|
|
|
|
*/
|
2008-02-08 15:53:45 +00:00
|
|
|
SharedHandle<ServerHost> searchServerHost(int32_t cuid) const;
|
2007-12-12 13:53:33 +00:00
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
SharedHandle<ServerHost> searchServerHost(const std::string& hostname) const;
|
2007-12-12 13:53:33 +00:00
|
|
|
|
|
|
|
void removeServerHost(int32_t cuid);
|
|
|
|
|
2008-02-08 15:53:45 +00:00
|
|
|
void removeURIWhoseHostnameIs(const std::string& hostname);
|
2007-12-29 07:02:35 +00:00
|
|
|
|
|
|
|
void reportDownloadFinished();
|
2008-04-25 17:44:03 +00:00
|
|
|
|
|
|
|
const std::deque<std::string>& getAcceptFeatures() const;
|
|
|
|
|
|
|
|
void addAcceptFeatureHeader(const std::string& feature);
|
|
|
|
|
|
|
|
void removeAcceptFeatureHeader(const std::string& feature);
|
|
|
|
|
2008-05-05 08:25:41 +00:00
|
|
|
const std::deque<std::string>& getAcceptTypes() const;
|
|
|
|
|
|
|
|
void addAcceptType(const std::string& type);
|
|
|
|
|
|
|
|
void removeAcceptType(const std::string& type);
|
|
|
|
|
|
|
|
static const std::string ACCEPT_METALINK;
|
2007-05-20 13:57:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef SharedHandle<RequestGroup> RequestGroupHandle;
|
2007-10-11 16:58:24 +00:00
|
|
|
typedef WeakHandle<RequestGroup> RequestGroupWeakHandle;
|
2008-02-08 15:53:45 +00:00
|
|
|
typedef std::deque<RequestGroupHandle> RequestGroups;
|
|
|
|
|
|
|
|
} // namespace aria2
|
2007-05-20 13:57:56 +00:00
|
|
|
|
|
|
|
#endif // _D_REQUEST_GROUP_H_
|