Fixed the bug that DH key exchange sometimes fails due to bad
handling
of the number of bytes required for storing public key and
shared
secret.
* src/LibgcryptDHKeyExchange.h
* src/LibsslDHKeyExchange.h: Also added function name to
handleError.
* src/MSEHandshake.cc
* test/DHKeyExchangeTest.cc
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)