Fixed the bug that prevents aria2 from stopping other than by
pressing
Ctrl-C in BitTorrent download. It is reproducible using
--seed-time
option. aria2 doesn't stop even after --seed-time is satisfied
and
continues to output blank lines in the console.
* src/ReceiverMSEHandshakeCommand.cc
* src/PeerReceiveHandshakeCommand.cc
* src/PeerListenCommand.cc
Make room for future enchancements for IPv6 addresses.
Bump up version number of dht.dat file format to 2.
Not compatible with previous version.
* src/DHTRoutingTableSerializer.cc
* src/DHTRoutingTableDeserializer.cc
* test/DHTRoutingTableSerializerTest.cc
Fixed the bug that a return code is always 0. BUG#1897704
If error occurred during the download or there exist unfinished
downloads, aria2 returns with code 1.
* src/RequestGroupMan.{h, cc}
* src/MultiUrlRequestInfo.{h, cc}
* src/main.cc
IPv6 support for SocketCore class.
TODO: In SocketCore::establishConnection(), this is insufficient
to
determin the failure of connect() here because the socket is
non-blocking state. The next addresses should be tried after
select().
TODO: NameResolver still uses c-ares(<= 1.4)
ares_gethostbyname().
If c-ares 1.5 or newer is installed, ares_getaddrinfo() should
be used
instead which address family independent.
TODO: DHTRoutingTable{Deserializer,Serializer} currently saves
peer
information in a compact peer format which is for IPv4 only.
Some BitTorrent functions in PeerMessageUtil still depends on
IPv4 but
this is a spec of BitTorrent protocol.
* src/SocketCore.{h, cc}
* src/PeerMessageUtil.cc
* test/SocketCoreTest.cc
* test/PeerMessageUtilTest.cc
* test/DHTConnectionImplTest.cc
Handle IPv4-mapped addresses.
* src/DHTNode.cc: Now identity is determined by node id.
* src/DHTMessageTrackerEntry.cc
Because now PeerMessageUtil::unpackcompact() could fail, the
caller
should handle it.
* src/DHTRoutingTableDeserializer.cc
* src/DHTMessageFactoryImpl.cc
Change the unit of --stop option from a minute to a second.
* src/usage_text.h
* src/DownloadEngineFactory.cc
* src/OptionHandlerFactory.cc
* src/message.h
* src/TimedHaltCommand.cc
Determin _threadtholdSpeed in each constructor for
ActivePeerConnectionCommand and PeerReceiveHandshakeCommand.
* src/ActivePeerConnectionCommand.{h, cc}
* src/PeerReceiveHandshakeCommand.{h, cc}
* src/BtSetup.cc
* src/BtConstants.h
Added the ability to load nodes from torrent file. These nodes are
added to the routing table when downloading that torrent.
* src/BtContext.h
* src/DefaultBtContext.{h, cc}
* src/DHTSetup.cc
* src/DHTEntryPointNameResolveCommand.{h, cc}: Now accepts list of
hostname and port pair, and resolves all of them.
* src/NameResolver.{h, cc}: Added reset().
* src/RequestGroup.cc
* test/DefaultBtContextTest.cc
* test/MockBtContext.h
Removed assert() from DefaultBtContext and throw exception instead.
* src/DefaultBtContext.cc
Added DHTMessageDispatcherImpl. Now DHTMessageDispatcher is pure
virtual.
* src/DHTMessageDispatcher.h
* src/DHTMessageDispatcherImpl.{h, cc}
* src/DHTSetup.cc
Added the ability to stop aria2 itself when given time has
passed
from start. Use --stop option to specify time in minutes.
When 0 is given, this feature is disabled.
* src/OptionHandlerFactory.cc
* src/TimeBasedCommand.h: Make _interval protected scope.
* src/HelpItemFactory.cc
* src/option_processing.cc
* src/prefs.h
* src/FillRequestGroupCommand.cc: Evaluate _e->isHaltRequested()
before calling RequestGroupMan::fillRequestGroupFromReserver().
Without this modification, the result list shows "ERR" when
aria2 is
stopped by --stop option. It should be "INPR".
* src/DownloadEngine.{h, cc}
* src/DownloadEngineFactory.cc
* src/usage_text.h
* src/TimedHaltCommand.{h, cc}: New class.
Bootstrap through node added by port message.
Currently bootstrap is executed if the number of buckets in routing
table is 1.
* src/BtPortMessage.{h, cc}
* src/DefaultBtMessageFactory.{h, cc}
* src/PeerInteractionCommand.cc
* test/BtPortMessageTest.cc
* test/MockDHTTask.h
Extract the Peer class's member variables, which are only needed
after
PeerInteractionCommand, into PeerSessionResource class.
This class is instantiated in PeerInteractionCommand class's
ctor and
released in its dtor.
This will make Peer class lightweight and uses less memory for
peers
which are not connected and wait in the queue.
* src/PeerChokeCommand.cc
* src/PeerSessionResource.{h, cc}
* src/PeerInteractionCommand.cc
* src/PeerAbstractCommand.cc: Note: 0 is given to onAbort()
function.
* src/DefaultBtInteractive.cc
* src/BtPieceMessage.cc
* src/BtInterestedMessage.cc
* src/BtUnchokeMessage.cc
* src/DefaultPeerStorage.{h, cc}
* src/PeerInitiateConnectionCommand.cc
* src/ActivePeerConnectionCommand.cc
* src/BtNotInterestedMessage.cc
* src/DefaultBtMessageDispatcher.cc
* src/BtChokeMessage.cc
* src/BtRequestMessage.cc
* src/Peer.{h, cc}
* src/BtRegistry.h
* src/TrackerWatcherCommand.cc
* src/PeerReceiveHandshakeCommand.cc
* test/BtExtendedMessageTest.cc
* test/BtAllowedFastMessageTest.cc
* test/BtCancelMessageTest.cc
* test/DefaultPieceStorageTest.cc
* test/BtBitfieldMessageTest.cc
* test/BtHaveMessageTest.cc
* test/BtNotInterestedMessageTest.cc
* test/BtRequestMessageTest.cc
* test/PeerSessionResourceTest.cc
* test/DefaultBtMessageDispatcherTest.cc
* test/PeerTest.cc
* test/BtInterestedMessageTest.cc
* test/BtRejectMessageTest.cc
* test/BtChokeMessageTest.cc
* test/DefaultPeerStorageTest.cc
* test/BtHaveNoneMessageTest.cc
* test/BtHaveAllMessageTest.cc
* test/DefaultExtensionMessageFactoryTest.cc
* test/BtUnchokeMessageTest.cc
* test/DefaultBtMessageFactoryTest.cc
* test/HandshakeExtensionMessageTest.cc
* test/UTPexExtensionMessageTest.cc
* test/DefaultBtRequestFactoryTest.cc
* test/BtPieceMessageTest.cc
Removed typedef PeerStats.
* src/PeerStat.h
* src/SegmentMan.cc
Only add socket to DownloadEngine's select routine when peer or
localhost is unchoked and interested. This lowers CPU usage a
little bit.
* src/PeerInteractionCommand.cc
* src/PeerAbstractCommand.{h, cc}
* src/BtInteractive.h
* src/DefaultBtInteractive.{h, cc}
Commented out ip address comparison because a host can have
multiple
ip addresses and it is hard to predict the hostname is resolved
into
which one.
* test/SocketCoreTest.cc (testWriteAndReadDatagram)
Fixed compiler warning about redefinition of SIZE_MAX.
Use common.h instead of config.h directly here.
* src/Platform.{h, cc}
The check of ENABLE_NLS is made in gettext.h, so it is not
required
here.
* common.h
2008-02-02 gettextize <bug-gnu-gettext@gnu.org>
Updated gettext related files.
* configure.ac (AC_CONFIG_FILES): Add intl/Makefile.
* configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.17.
Added DHT functionality, compatible with mainline.
DHT is disabled by default. To enable it, give --enable-dht to
aria2c.
You may need to specify entry point to DHT network using
--dht-entry-point. DHT uses UDP port to listen incoming message.
Use --dht-listen-port to specify port number. Make sure that
your
firewall configuration can pass through UDP traffic to the port.
The routing table is saved in $HOME/.aria2/dht.dat.
* src/DHT*
* src/BNode.{h, cc}
* src/PeerInteractionCommand.cc: enable DHT functionality for a
particular torrent.
* src/Data.cc: Rewritten ctor.
* src/OptionHandlerFactory.cc: Added --enable-dht,
--dht-listen-port,
--dht-entry-point.
* src/DefaultBtInteractive.cc: Send port message if dht is
enabled.
* src/RequestGroup.cc: Initialize DHT functionality. When
download
ends, remove BtContext from DHTPeerAnnounceStorage.
* src/BtPortMessage.{h, cc}: Rewritten.
* src/message.h
* src/OptionHandlerImpl.cc
* src/option_processing.cc: Added --enable-dht,
--dht-listen-port,
--dht-entry-point.
* src/Dictionary.{h, cc} (remove): New function.
* src/prefs.h
* src/DefaultBtMessageFactory.h
* src/BtHandshakeMessage.cc
* src/ActivePeerConnectionCommand.cc
* src/SocketCore.{h, cc}: Added datagram socket support.
* src/DefaultBtMessageFactory.cc
* src/BtSetup.cc: Add BtContext to DHTPeerAnnounceStorage here.
Create DHT commands.
* src/BtMessageFactory.h
* src/PeerMessageUtil.{h, cc}
Fixed the bug that log file is not written when configuration
file doesn't exist.
This is caused by using Logger class before LogFactory is not
configured.
BUG #1875079
* src/option_processing.cc
Warning message "configuration doesn't exist" is only printed
when --conf is
given.
* src/option_processing.cc
Added --no-conf and --conf-path command-line option.
--no-conf option disables loading aria2.conf file.
--conf-path option changes the configuration file path. The
default
file path is $HOME/.aria2/aria2.conf
Added a warning message when the configuration file is not
found.
* src/HelpItemFactory.cc
* src/option_processing.cc
* src/prefs.h
* src/usage_text.h
Added the message to inform users that other help categories are
available in -h option.
* src/version_usage.cc
* src/TagContainer.{h, cc}
* test/TagContainerTest.cc
* src/TaggedItem.{h, cc}
* test/TaggedItemTest.cc
* src/HelpItem.h
Added Piece::getFirstMissingBlockIndexWithoutLock() and it is
called
from PiecedSegment's ctor.
Previously Piece::getAllMissingBlockIndexes() is called from
PiecedSegment() but it is rather expensive since only first
element is
used.
* src/PiecedSegment.cc
* src/Piece.{h, cc}
Rewritten get*Missing*Index functions. Now no need to allocate
memory
each time these functions are called.
* src/BitfieldMan.{h, cc}
* test/BitfieldManTest.cc
* src/array_fun.h
* test/array_funTest.cc
Now BitfieldMan::countBlock() returns BitfieldMan::blocks.
Added new BitfieldMan::countFilteredBlock() to get the number of
blocks
filtered. Removed unnecessary cast to int32_t.
* src/BitfieldMan.{h, cc}
2008-01-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that EX_TOO_LONG_PAYLOAD exception is thrown if just
payload length(4bytes) are received. This happens because lenbufLength
is not updated in this particular case and successive call of
receiveMessage() overwrites payload length with bytes recieved which
are payload body.
* src/PeerConnection.{h, cc}
* src/message.h
Fixed the bug that EX_TOO_LONG_PAYLOAD exception is thrown if just
payload length(4bytes) are received. This happens because lenbufLength
is not updated in this particular case and successive call of
receiveMessage() overwrites payload length with bytes recieved which
are payload body.
* src/PeerConnection.cc
* src/message.h
Fixed the bug that DefaultPeerStorage::returnPeer() may delete wrong
peer if there are peers that have same ipaddr and port.
I've experiened segmentation fault and "pure virtual function was
called" error.
* src/Peer.h
* test/PeerTest.cc
* src/DefaultPeerStorage.cc
* test/DefaultPeerStorageTest.cc
Removed a call to isPowerOf() because it is no longer necessary
here
and a request block is not always power of 2.
BUG#1866924
* src/PeerMessageUtil.cc (checkLength)
Fixed the bug that always first found Segment is removed from
usedSegmentEntries. Removed unused functions.
* src/SegmentMan.{h, cc}
* test/SegmentManTest.cc
Fixed the bug that ServerHost is not removed.
* src/RequestGroup.cc
Fixed the bug that SegmentMan::completeSegment() is not called
even if Segment is complete when --lowest-speed-limit is
enabled.
BUG#1864525
* src/DownloadCommand.{h, cc}
Move extension from BtRuntime to ExtensionMessageFactory, because
extension can be specified per peer, not per torrent.
* src/DefaultBtInteractive.cc
* src/BtRuntime.h
* src/ExtendedMessagingAware.h
* src/ExtensionMessageFactory.h
* src/DefaultExtensionMessageFactory.cc
* test/DefaultExtensionMessageFactoryTest.cc
Fixed segmentation fault when bad torrent metainfo is parsed.
Added dynamic_cast properly to detect the misconfiguration of
metainfo
and then throw exception or skip it.
* src/DefaultBtContext.{h, cc}
* test/DefaultBtContextTest.cc
* src/AnnounceList.cc
* src/CompactPeerListProcessor.cc
* src/message.h
* src/DefaultBtAnnounce.{h, cc}
* test/DefaultBtAnnounceTest.cc
* src/BencodeVisitor.cc
Added missing "B"(=Byte). So now the message looks like this:
Your share ratio was 1.0, uploaded/downloaded=12MiB/12MiB
* src/message.h (MSG_SHARE_RATIO_REPORT)
Show the seed ratio after torrent downloads.
For example, after torrent download completed and --seed-time
and
--seed-ratio conditions are fulfilled, following message is
printed
right after "Download complete: .....":
Your share ratio was 1.0, uploaded/downloaded=12M/12M
* src/RequestGroupMan.cc
* src/RequestGroup.{h, cc}
* src/message.h
Remove a defunct control file. A defunct control file means that
while
it exists, but the corresponding download file is missing.
After its removal, a download restarts from the beginning.
* src/RequestGroup.cc
* src/message.h
Allocate bitfield in Peer when it is really used. More
specifically,
bitfield in Peer is allocated after the connection is
established and
deallocated when the connection is dropped.
Since 2 parameters(piece length and total length) was removed
from the
constructor of Peer class, many test classes were modified
accordingly.
See svn log for more detailed information.
* src/PeerInteractionCommand.cc
* src/CompactPeerListProcessor.cc
* src/Peer.cc
* src/DefaultPeerListProcessor.cc
* src/PeerListenCommand.cc
* src/PeerReceiveHandshakeCommand.cc
Fixed memory leak
* src/Piece.cc
Changed the default value of PREF_PEER_CONNECTION_TIMEOUT and
lowestSpeedLimit in ActivePeerConnectionCommand. TODO: Make them
command-line options.
* src/option_processing.cc
* src/ActivePeerConnectionCommand.cc
2007-12-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Removed incomingPeer. Set 0 to peer's port if it is not a listening
port.
* src/DefaultPeerStorage.{h, cc}
* test/DefaultPeerStorageTest.cc
* src/HandshakeExtensionMessage.cc
* test/HandshakeExtensionMessageTest.cc
* src/Peer.{h, cc}: Added ipaddr and port to identity comparison.
* src/PeerStorage.h
* test/MockPeerStorage.h
* src/PeerListenCommand.cc
* src/PeerReceiveHandshakeCommand.cc
Removed incomingPeer. Set 0 to peer's port if it is not a listening
port.
* src/DefaultPeerStorage.{h, cc}
* test/DefaultPeerStorageTest.cc
* src/HandshakeExtensionMessage.cc
* test/HandshakeExtensionMessageTest.cc
* src/Peer.{h, cc}: Added ipaddr and port to identity comparison.
* src/PeerStorage.h
* test/MockPeerStorage.h
* src/PeerListenCommand.cc
Fixed the bug that causes aria2 not to finish download.
BUG#1855875.
I could reproduce this bug in following procedure:
1. Stop the download at the very beginning(1% or 100KB
downloaded).
2. Restart aria2.
3. You see the download stopped around 99%.
* src/HttpResponseCommand.cc (handleDefaultEncoding)
* src/StreamFileAllocationEntry.cc: Removed the timeout
handling.
If timeout is reached, then _nextCommand is unused and it may
contains
segments and they won't be canceled. Actually, timeout is not
needed
here because if the server dropped connection, then retry is
made.
Added uTorrent compatible Peer Exchange.
* src/BencodeVisitor.{h, cc}
* test/BencodeVisitorTest.cc
* src/BtConstants.h
* src/BtContext.h: Added 'private' flag.
* src/BtExtendedMessage.{h, cc}
* test/BtExtendedMessageTest.cc
* src/BtHandshakeMessage.{h, cc}: Set extended messaging bit in
reserved field.
* test/BtHandshakeMessageTest.cc
* src/BtMessageFactory.h
* src/BtRegistry.h
* src/BtRuntime.h: This class holds default extension message
IDs for
aria2. By default, aria2 uses ID 8 for ut_pex.
* src/DefaultBtContext.cc
* src/DefaultBtInteractive.{h, cc}: This class holds
_utPexEnabled.
When it is true, aria2 enables ut_pex. This value is set by
PeerInteractionCommand.
* src/DefaultBtMessageFactory.{h, cc}
* test/DefaultBtMessageFactoryTest.cc
* src/DefaultBtMessageReceiver.cc: Moved the code of fast
extension
handling to DefaultBtInteractive class.
* src/DefaultExtensionMessageFactory.{h, cc}
* test/DefaultExtensionMessageFactoryTest.cc
* src/DefaultPeerStorage.cc: Returns false if a peer is already
in
the container(peers and incomingPeers. The equality is
determined by
Peer::id).
* test/DefaultPeerStorageTest.cc
* src/ExtensionMessage.h
* test/MockExtensionMessage.h
* src/ExtensionMessageFactory.h
* test/MockExtensionMessageFactory.h
* src/HandshakeExtensionMessage.{h, cc}
* test/HandshakeExtensionMessageTest.cc
* src/MetaEntry.h
* src/Peer.{h, cc}
* src/PeerInteractionCommand.cc
* src/PeerReceiveHandshakeCommand.cc: Evaluate the return value
of
addIncomingPeer.
* src/PeerMessageUtil.{h, cc}
* src/PeerObject.h
* src/UTPexExtensionMessage.{h, cc}
* test/UTPexExtensionMessageTest.cc
* src/message.h
* src/prefs.h
Fixed the bug that returns incomplete data when it contains null
character. A convenient constructor was also added.
* src/Data.{h, cc}
Rewritten.
* src/CompactPeerListProcessor.cc
Fixed typos.
* src/message.h
* src/MetaFileUtil.cc
Fixed the bug that prevents aria2 from loading cookie file when
expire
value is greater than 2^31-1. BUG#1851066
* src/CookieBoxFactory.cc
* test/CookieBoxFactoryTest.cc
Fixed possible memory leak when an exception is thrown.
* src/XML2SAXMetalinkProcessor.cc
Added Expat support. If both libxml2 and Expat are installed,
then
libxml2 is used by default.
MetalinkProcessorFactory chooses from XML2SAXMetalinkProcessor
and
ExpatMetalinkProcessor according to the configuration.
* src/ExpatMetalinkProcessor.{h, cc}
* src/main.cc: Removed libxml2 specific header and init/free
function.
* src/MetalinkProcessorFactory.{h, cc}
* src/MetalinkHelper.cc
* src/Metalinker.h: Removed unnecessary libxml2 header.
* src/MetalinkProcessor.h
* test/XML2SAXMetalinkProcessorTest.cc: Removed because
MetalinkProcessorTest is used instead.
* test/MetalinkProcessorTest.cc: Added. It is actually the same
with
XML2SAXMetalinkProcessor, replaced XML2SAXMetalinkProcessor with
MetalinkProcessorFactory::newInstance().
* m4/libexpat.m4
* configure.ac: Added configuration options for libexpat.
If several protocols are available for a mirror, aria2 now use
one of
them. --metalink-preferred-protocol option was added to specify
the
preference of protocol.
* src/AbstractCommand.cc
* src/OptionHandlerFactory.cc
* src/ServerHost.{h, cc}
* src/Metalink2RequestGroup.cc
* src/RequestGroup.{h, cc}
* test/RequestGroupTest.cc
* src/option_processing.cc
* src/prefs.h
* src/HttpResponseCommand.cc
* src/MetalinkResource.{h, cc}
* src/FtpNegotiationCommand.cc
* src/MetalinkEntry.{h, cc}
* src/MetalinkEntryTest.cc
Fixed the bug: only first announce URL is tried in AnnounceTier,
in stopped and completed event.
* src/AnnounceList.{h, cc}
* test/AnnounceListTest.cc
* src/DefaultBtAnnounce.cc
* test/DefaultBtAnnounceTest.cc
Sorted URLs.
* test/Metalink2RequestGroupTest.cc
Fixed the bug#1845750; CTRL+C does not stop torrent.
aria2 repeatedly sends stopped request when tracker returns error code.
* src/AnnounceList.cc
* test/AnnounceListTest.cc
* src/AnnounceTier.h
Added a message when ctrl-c is hit.
Now second ctrl-c is also handled in signal handler.
* src/RequestGroupMan.{h, cc}
* src/RequestGroup.{h, cc}
* src/MultiUrlRequestInfo.cc
* src/DownloadEngine.cc
* src/TrackerWatcherCommand.cc
Added XML2SAXMetalinkProcessor class, which is a lot faster than
the predecessor, Xml2MetalinkParser class.
I tested them against 94KB metalink file with 1234 chunk
checksums.
The new one parsed it in 22msec, while it took 6000msec with old
one.
* src/XML2SAXMetalinkProcessor.{h, cc}
* test/XML2SAXMetalinkProcessorTest.cc
* src/MetalinkParserController.{h, cc}
* test/MetalinkParserControllerTest.cc
* src/MetalinkParserState.h: Also added 16 subclasses.
* src/main.cc
* src/Metalink2RequestGroup.cc
* src/MetalinkHelper.cc
* src/MetalinkEntry.cc
* src/ChunkChecksum.h
Rewritten Base64 class for better performance.
* src/Base64.{h, cc}
* test/Base64Test.cc
* src/HttpRequest.cc
Fixed the bug#1841757: aria2 will connect to server to only get
file size.
* src/StreamFileAllocationEntry.cc
* src/option_processing.cc
* src/HttpResponseCommand.cc: Now reuse connection in segmented
downloads.
* src/FtpNegotiationCommand.cc
Suppressed wrong message when finding PreDownloadHandler
* src/RequestGroup.cc
Added direct I/O support. The current implementation uses O_DIRECT,
which is not posix standard and is tested on linux 2.6.21.
Currently only file allocation uses direct I/O.
* src/SingleFileAllocationIterator.{h, cc}
* test/SingleFileAllocationIteratorTest.cc
* src/MultiFileAllocationIterator.{h, cc}
* test/MultiFileAllocationIteratorTest.cc
* src/BinaryStream.h
* src/DiskWriter.h
* src/AbstractDiskWriter.{h, cc}
* src/ByteArrayDiskWriter.h
* src/DiskAdaptor.h
* src/AbstractSingleDiskAdaptor.{h, cc}
* src/MultiDiskAdaptor.{h, cc}
* src/FileAllocationEntry.cc
* src/Util.{h, cc}
* src/OptionHandlerFactory.cc
* src/prefs.h
* src/version_usage.cc
* src/option_processing.cc
Moved FileAllocationMan::markCurrentFileAllocationEntryDone() to
handleException.
* src/MultiFileAllocationIterator.cc
Added EINTR handling
* src/SocketCore.cc
Set Content-Type to SingleFileDownloadContext when http response
is
received.
* src/HttpResponseCommand.cc
* src/HttpResponse.{h, cc}
* test/HttpResponseTest.cc
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
Added the check to see whether ares_host_callback accepts
timeouts
with c-ares; only c-ares 1.5.0 or newer accepts it.
* src/NameResolver.{h, cc}
* m4/libcares.m4
* configure.ac: Set C++ for language choice.
Fixed: compilation fails without c-ares/ares
* src/DownloadEngine.cc (addCommand): Moved outside #ifdef
Generate http/ftp commands only when download is incomplete.
* src/BtFileAllocationEntry.cc (prepareForNextAction)
Throw DlAbortEx when a remote file is not found.
* src/HttpResponse.cc
* src/FtpNegotiationCommand.cc
* src/message.h
Overwrite an existing file if --allow-overwrite=true is given.
* src/RequestGroup.cc
Removed unused functions
* src/AbstractCommand.h
Trim announce URL
* src/DefaultBtContext.cc
* test/ShaVisitorTest.cc
Trim argument s. Give trimed s to exception constructor.
* src/Util.cc (parseInt)(parseLLInt)
* test/UtilTest.cc
Preallocate non-requested file which is adjacent forward to
requested
file('requested' files means the files given in --select-file
option)
if they share a same piece.
This fixes long pause in the file system which doesn't support
sparse
files like FAT32 while downloading.
* src/MultiFileAllocationIterator.{h, cc}
* test/MultiFileAllocationIteratorTest.cc
* src/FileEntry.{h, cc}
Removed unused _option.
* src/MultiDiskAdaptor.h
* test/MultiDiskAdaptorTest.cc
* src/DefaultPieceStorage.cc
Set the default value of --seed-ratio to 1.0.
If 0.0 is given, then seeding continues regardless of share
ratio.
* src/version_usage.cc
* src/option_processing.cc
* src/BtSetup.cc
* doc/aria2c.1.txt
* doc/aria2c.1
Fixed: Selective download is not working in BitTorrent
* src/RequestGroup.cc
Introduced Sequence class. Use this instead of
Util::unfoldRange()
* src/PieceStorage.h
* test/MockPieceStorage.h
* src/UnknownLengthPieceStorage.h
* src/DefaultPieceStorage.{h, cc}
* src/Metalink2RequestGroup.cc
* src/RequestGroup.cc
* src/Sequence.h
* test/SequenceTest.cc
* src/IntSequence.h
* src/message.h
* src/Util.{h, cc}
* test/UtilTest.cc
Added new function 'parse' to catch exception thrown by
subclass's
parseArg
* src/OptionHandler.h
* src/OptionParser.cc
* src/NameMatchOptionHandler.h
* src/OptionHandlerImpl.h
* test/OptionHandlerTest.cc
Added IntegerRangeOptionHandler. Used for --listen-port and
--select-file. Now --listen-port accepts range of port.
* src/OptionHandlerFactory.cc
* src/version_usage.cc
* src/OptionHandlerImpl.h
* src/option_processing.cc
* src/BtSetup.cc
* src/PeerListenCommand.{h, cc}
* doc/aria2c.1.txt
* doc/aria2c.1
Implemented operator< for Exception class to provide easy way to
print
exception stack trace.
* src/Exception.{h, cc}
* src/main.cc
* src/option_processing.cc
* src/version_usage.cc
(showVersion): Reworked.
(showUsage): Added examples.
Removed Hint for total length and file name.
* src/Metalink2RequestGroup.cc
* src/RequestGroup.{h, cc}
* src/HttpResponseCommand.cc
* src/FtpNegotiationCommand.cc
Now --follow-torrent and --follow-metalink option work properly.
* src/RequestGroup.cc
Updated man page
* doc/aria2c.1.txt
* doc/aria2c.1
Added the ability to detect duplicate download entry which is
about to
download the same file other RequestGroup is downloading.
* src/RequestGroup.cc
* src/HttpResponseCommand.cc
* src/FtpNegotiationCommand.cc
Recalculates download progress when loading a control file,
if the piece length of DownloadContext is different from the one
saved
in the control file. Currently in-flight pieces are ignored.
* src/DefaultBtProgressInfoFile.cc
* test/DefaultBtProgressInfoFileTest.cc
* src/Util.{h, cc}
* test/UtilTest.cc
Do not rotate tiers in announce-list.
* src/DefaultBtAnnounce.{h, cc}: Removed trackerNumTry.
AnnounceList::allTiersFailed() used instead to detect whether
all
tiers are tried and failed.
* test/DefaultBtAnnounceTest.cc
* src/AnnounceList.{h, cc}: If all tiers are tried and failed
then
allTiersFailed() returns true. To reset tier pointer, call
resetTier();
* test/AnnounceListTest.cc
* src/TrackerWatcherCommand.cc (execute): Removed DlAbortEx
catch
clause. Catch RecoverableException instead of DlRetryEx instead.
Implemented checksum validation feature(1 checksum for each
file)
The validation takes place after the download.
* src/PieceHashCheckIntegrityEntry.{h, cc}: New class.
* src/IteratableChecksumValidator.{h, cc}: Rewritten.
* src/CheckIntegrityCommand.cc: Changed log message.
* src/Metalink2RequestGroup.cc: Set checksum to
SingleFileDownloadContext.
* src/StreamCheckIntegrityEntry.{h, cc}: Now derived from
PieceHashCheckIntegrity class.
* src/BtCheckIntegrityEntry.{h, cc}: Now derived from
PieceHashCheckIntegrity class.
* src/ChecksumCheckIntegrityEntry.{h, cc}: New class.
* src/IteratableValidator.h: New class.
* src/message.h
* src/CheckIntegrityEntry.{h, cc}
* src/IteratableChunkChecksumValidator.{h, cc}
* src/SingleFileDownloadContext.h
* src/DownloadCommand.cc
--allow-overwrite=true is no longer needed to check file
integrity
before download in BitTorrent download.
* src/RequestGroup.cc (getInitialCommand)
Removed RequestGroup from queue when
RequestGroup::getInitialCommand()
throws exception.
* src/RequestGroupMan.cc (getInitialCommands)
urlencode the given url inside Request::parseUrl(...)
* src/Request.{h, cc}
* src/Util.{h, cc}
* test/RequestTest.cc
Removed #!metalink3! notation support because it is deleted from
the metalink specification.
* src/Request.{h, cc}
* test/RequestTest.cc
Changed CheckIntegrityEntry interface so that it can define
the action when all the chunk checksums are valid.
* src/CheckIntegrityEntry.h
* src/StreamCheckIntegrityEntry.{h, cc}
* src/BtCheckIntegrityEntry.{h, cc}: Currently,when all the
checksums
are valid, then aira2 goes to seeding mode. Sometimes it is
better
to exit rather than doing seeding. So, it would be good to
toggle this
behavior.
* src/CheckIntegrityCommand.cc
* src/AbstractCommand.cc
* src/RequestGroup.cc
Reflect the download length of in-flight pieces.
It makes the download length readout more precise.
* src/DefaultPieceStorage.{h, cc}
* test/DefaultPieceStorageTest.cc
* src/a2functional.h
* test/a2functionalTest.cc
Lower CPU load when --max-download-limit is used.
There is up and down in speed indicator when enabling
http-pipelining but a download goes well. I think the problem is
that
because http-pipelining is enabled, DownloadCommand is created
for
each segment and in its constructor, PeerStat::downloadStart()
is
called. In PeerStat::downloadStart(), speed calculation object
is
reseted, which makes download speed zero.
* src/DownloadCommand.cc
Rewritten using accumulate.
* src/RequestGroupMan.cc (calculateStat)
Code clearnup.
* src/FtpNegotiationCommand.cc
* src/HttpResponseCommand.cc
Now a file is stored in the directory specified in .metalnk file
(file[@name]).
* src/Metalink2RequestGroup.cc
Create the directory structure when opening the file if it
doesn't
exist.
* src/AbstractDiskWriter.cc
* src/Util.{h, cc}
* src/File.h
* test/UtilTest.cc
Removed file name comparison
* src/Metalink2RequestGroup.cc
* src/HttpResponseCommand.cc
Rewritten using Util::mkdirs()
* src/FileEntry.cc (setupDir)
* test/FileEntryTest.cc
Updated doc
* src/SingleFileDownloadContext.h
Now SleepCommand dispatches nextCommand when halt is requested.
It avoids a possible long wait after hitting CTRL-C.
* src/SleepCommand.{h, cc}
* src/RequestGroupAware.{h, cc}
Fixed: the listen port sent to the tracker is wrong. If aria2
fails
to open listen port, then remove the port number from the
tracker
request.
* src/DefaultBtAnnounce.cc
* test/DefaultBtAnnounceTest.cc
* test/MockPieceStorage.h
Inject randomizer to DefaultBtAnnounce and DefaultBtContext to
make
them more testable.
* src/DefaultBtAnnounce.{h, cc}
* src/DefaultBtContext.{h, cc}
* src/Util.{h, cc}
* test/DefaultBtAnnounceTest.cc
* test/DefaultBtContextTest.cc
* test/UtilTest.cc
Added 'B' to upload bytes readout.
* src/ConsoleStatCalc.cc
Now the listen port for BitTorrent download is opened when it is
needed.
* src/DownloadEngineFactory.cc
* src/BtSetup.{h, cc}
* src/PeerListenCommand.{h, cc}
Now an exception thrown while parsing tracker response is now
logged.
If DlAbortEx is catched, then btAnnounce->resetAnnounce()
immediately
called, which means no retry is made in this case, assuming a
tracker
has a problem.
* src/TrackerWatcherCommand.cc
Fixed: downloading a file whose length is unkown fails.
* src/DownloadCommand.cc
Simplified prepareForNextSegment()
* src/DownloadCommand.cc
Updated
* po/POTFILES.in
Re-implemented a file listing for Metalink, which was dropped
while
http/ftp/torrent integration was being implemented.
* src/MetalinkHelper.{h, cc}: New class.
* test/MetalinkHelperTest.cc
* src/main.cc
* src/Metalink2RequestGroup.cc
Added the ability to display the detailed torrent file
information.
Now -S option gives not only a file listing, but also total
download
length, info hash, announce URI, piece length, the number of
pieces,
and mode(single or multi-torrent).
* src/DefaultBtContext.{h, cc} (operator<<): New function.
* src/Util.cc (toStream): Show file length in a abbreviated
form(like
KiB)
* test/UtilTest.cc
* src/main.cc
Use RequestGroup::allDownloadFinished() to decide whether the
control
file should be removed or saved.
* src/RequestGroup.{h, cc} (allDownloadFinished): New function.
* src/RequestGroupMan.cc (removeStoppedGroup) (save)
* src/Piece.{h, cc}: Added SubPiece infrastructure to track down
the data smaller than block length.
A block length can be specified by constructor's argument.
* src/DefaultPieceStorage.{h, cc} (getMissingPiece):
Get a missing piece in the range of given FileEntry. This
function is
not used in the program yet.
* src/Util.h: Added some macros.
* src/Metalink2RequestGroup.cc (generate): Throw exception
instead of
catching it inside the method.
When no file entry is found in a metalink without querying user
preferences, throw the exception with the error message that
suggests
metalink file is probably broken.
* src/RequestGroup.cc (postDownloadProcessing): Catch exception
here.
* src/MultiUrlRequestInfo.h: Updated the message shown when
program
stops and there are any unfinished or in-progress downloads.
Added the legend of "stat".
Implemented BitTorrent/http/ftp integrated download.
I've rewritten lots of files and now some headers have forward
class declarations to reduce compile time.
The implementation is extremely alpha stage, I recommend to use this
for testing purpose only.
Disable parameterized URI support by default. Added -P option to
enable the feature.
* src/prefs.h: Added PREF_PARAMETERIZED_URI
* src/OptionHandlerFactory.cc
* src/main.cc: Also updated usages for -Z and
--auto-file-renaming
Updated Japanese translation.
* po/ja.po
Automatically save *.aria2 control file of http/ftp download in
every
60 seconds.
* src/AutoSaveCommand.{h, cc}: New class.
* src/TimeBasedCommand.{h, cc}: New class.
* src/DownloadEngineFactory.cc (newConsoleEngine)
Now *.aria2 contorol file is first saved to *.aria2__temp and if
it is successful, then renamed to *.aria2.
This prevents *.aria2 file from being truncated or corrupted
when
file system becomes out of space.
* src/DefaultBtProgressInfoFile.cc (save)
* src/SegmentMan.cc (save)
* test/DefaultBtProgressInfoFileTest.cc (testSave): Implemented.
Added the ability to disable segmented download in .metalink.
aria2 can now recognize 'maxconnections' attribute in
'resources' and
'url' tag.
* src/MetalinkEntry.{h, cc}
* src/RequestResource.{h, cc}
* src/MetalinkRequestInfo.cc
* src/Xml2MetalinkProcessor.cc
* test/Xml2MetalinkProcessorTest.cc
Added parameterized URI support.
* src/main.cc: -Z option added.
* src/OptionHandlerFactory.cc
* src/prefs.h: Added PREF_FORCE_SEQUENTIAL.
* src/PStringDatum.h: New class.
* src/PStringSegment.{h,cc}: New class.
* src/PStringNumLoop.h: New class.
* src/PStringSelect.h: New class.
* src/NumberDecorator.h: New class.
* src/FixedWidthNumberDecorator.h: New class.
* src/AlphaNumberDecorator.h: New class.
* src/PStringVisitor.h: New class.
* src/PStringBuildVisitor.{h,cc}: New class.
* src/ParameterizedStringParser.{h,cc}: New class.
* src/Util.{h,cc}
(isNumber): New function.
(isLowercase): New function.
(isUppercase): New function.
(alphaToNum): New function.
* test/ParameterizedStringParserTest.cc: New class.
* test/AlphaNumberDecoratorTest.cc: New class.
* test/PStringBuildVisitorTest.cc: New class.
* test/UtilTest.cc
(testIsNumber): New function.
(testIsLowercase): New function.
(testIsUppercase): New function.
(testAlphaToNum): New function.
Added '\n' after the error message
* src/RequestInfo.h (printDownloadAbortMessage)
Avoid sparse files if possible, because VFAT32 doesn't support
it.
* src/DefaultDiskWriter.cc (initAndOpenFile)
Fixed the bug that prevents file allocation is not done when
dowloading multi-torrent file.
* src/AbstractDiskWriter.cc (openFile)
Increase the maximum number of -j option from 15 to 45.
* src/OptionHandlerFactory.cc (createOptionHandlers)
Added fr.po, thanks to Charles Landemaine.
* po/fr.po
* po/LINGUAS
Increased the initial connection size in BitTorrent download to
40.
* src/BtRuntime.h
Added the usage message of --peer-id-prefix option.
* src/main.cc
Make a2netcompat.h include a2io.h to fix compilation error:
* src/a2netcompat.h
* src/SocketCore.cc: Removed include of a2io.h
* src/Util.cc: Removed include of a2io.h
Gather time related functions to a2time.h:
* src/a2time.h: New file.
* src/DefaultPeerStorage.cc
* src/SimpleLogger.cc
* src/Util.{h, cc}
* src/SimpleRandomizer.h
* src/TimeA2.{h,cc}
* src/DownloadCommand.cc
* src/main.cc
Removed #ifdef __MINGW32__ since gai_strerror is included in
a2netcompat.h:
* src/NameResolver.cc
Fixed compilation error without openssl:
* src/SocketCore.{h,cc}: Moved include of openssl/err.h to
SocketCore.h
Added default block to suppress compiler warnings:
* src/MetalinkRequestInfo.cc (AccumulateNonP2PUrl::operator())
2007-07-26 Ross Smith II <aria2spam at smithii dot com>
MinGW build enhancements. The following files are added:
* src/gai_strerror.{c,h}
* src/gettimeofday.{c,h}
Changes to support the above new files:
* configure.ac
* src/Makefile.am
* src/a2netcompat.h
* src/TimeA2.cc
* src/DefaultPeerStorage.cc
* src/NameResolver.cc: removed mingw_strerror() function.
* src/SocketCore.cc: removed mingw_strerror() function.
Miscellaneous MinGW build fixes.
* src/a2io.h: Use _lseeki64() instead of lseek()
* src/common.h
* src/DefaultFileAllocator.cc
* src/GlowFileAllocator.cc
* src/main.cc: Moved #include "prefs.h" to quiet compile error.
* src/NameResolver.cc
(callback): Changed int32_t to int.
(resolve): Changed int32_t to int.
* src/Platform.cc
* src/Platform.h
* test/MultiDiskWriterTest.cc
* test/PeerMessageUtilTest.cc
* src/localtime_r.c: Add DeleteCriticalSection() and at exit().
Other enhancements and fixes.
* src/HttpRequestCommand.cc
(executeInternal) Use non-blocking socket for HTTPS (MinGW
only).
* src/SocketCore.cc:
(error): New function to abstract errno/WSAGetLastError().
(errorMsg): New function to abstract errno/WSAGetLastError().
(initiateSecureConnection): Added more detailed error reporting.
* src/SocketCore.h: Added private variable blocking, to allow
proper handling of OpenSSL psuedo-errors.
* src/message.h
(EX_SSL_INIT_FAILURE)
(EX_SSL_IO_ERROR)
(EX_SSL_PROTOCOL_ERROR)
(EX_SSL_UNKNOWN_ERROR)
(EX_SSL_CONNECT_ERROR)
(EX_SOCKET_BLOCKING)
(EX_SOCKET_NONBLOCKING)
(EX_SOCKET_UNKNOWN_ERROR)
* src/Util.cc
(setGlobalSignalHandler): Renamed signal to sig as signal is a
reserved name.
(httpGMT): Fixed typo.
Merged Ross's win32 patch(manually)
In the course of merging, following files are added.
* src/strptime.{h,c}
* src/libgen.{h,c}
* src/inet_aton.{h,c}
* src/Platform.{h,cc}
* src/localtime_r.{h,c}
* src/getaddrinfo.{h,c}
I've gethered network related things, and put them to following
file:
* src/a2netcompat.h
Also io related things are put to following file:
* src/a2io.h
Changed %lld to %s because mingw32 doesn't recognize %lld.
* src/message.h
(MSG_ALLOCATION_COMPLETED)
(EX_TOO_LARGE_FILE)
(EX_SIZE_MISMATCH)
(EX_FILE_OFFSET_OUT_OF_RANGE)
(EX_INVALID_CHUNK_CHECKSUM)
(EX_INVALID_RANGE_HEADER)
* src/FileAllocationCommand.cc
* src/HttpResponse.cc
* src/RequestGroup.cc
* src/MultiDiskAdaptor.cc
* src/OptionHandlerImpl.h
* src/HttpResponseCommand.cc
* src/FtpNegotiateCommand.cc
* src/IteratableChecksumValidator.cc
* src/SegmentMan.cc
* src/ChunkChecksumValidator.cc
Added Randomizer::getRandomNumber(long int)
* src/Randomizer.h (getRandomNumber)
* src/SimpleRandomizer.h (getRandomNumber)
* src/BitfieldMan.cc (getMissingIndexRandomly): Use this new
function.
* src/Util.cc (randomAlpha): Use this new function.
Fixed the bug that prevents cookies from being sent to the
server
if the domain of cookie is FQDN and starts with ".".
* src/Cookie.cc (match)
To add the ability to change peer id.
* src/DefaultBtContext.h
(_peerIdPrefix): New variable
(setPeerIdPrefix): New function.
* src/torrentRequestInfo.cc
(execute): Set the option value of PREF_PEER_ID_PREFIX to
DefaultBtContext.
* src/main.cc (main): Added peer-id-prefix command-line option.
The usage message is not added yet.
* src/DefaultBtContext.cc
(generatePeerId): Use _peerIdPrefix.
* src/prefs.h (PREF_PEER_ID_PREFIX): New definition.
Fixed the bug that prevents filename in content-disposition from
being retrieved when filename is not quoted.
* src/Util.cc (getContentDispositionFilename)
Fixed the bug that causes infinate loop and memory leak when
file open
operation failed.
* src/HttpResponseCommand.cc (handleDefaultEncoding)
Fixed the bug that causes segfault when all URIs specified are
unsupported.
* src/RequestGroupMan.cc (getInitialCommands)
Check if RequestGroup::createNextCommand() returns empty list of
commands.
* src/RequestGroup.cc (createNextCommand)
Change log level from info to error so that users can notice
that
an error occurred.
Fixed the bug that causes segfault when a zero-sized file is
downloaded.
* src/BitfieldMan.cc (isAllBitSet)
Return true if bitfieldLength is 0.