Removed peerStorage from DHTPeerAnnounceEntry. It is unlikely to
receive get_peers request for torrent which the client is now
downloading.
* src/BtSetup.cc
* src/DHTPeerAnnounceEntry.cc
* src/DHTPeerAnnounceEntry.h
* src/DHTPeerAnnounceStorage.cc
* src/DHTPeerAnnounceStorage.h
* src/RequestGroup.cc
* test/DHTPeerAnnounceEntryTest.cc
* test/DHTPeerAnnounceStorageTest.cc
Added StringFormat class, which internally calls vasprintf.
operator<< is defined for this class, so it can be used with iostream
classes nicely. SimpleLogger and following functions are rewritten
using StringFormat class.
Besides, now Logger class's methods are non-const, many classes
that has a const Logger* as a member variable are modified to remove
const qualifier from the variable declaration.
* src/HelpItemFactory.cc
* src/Request.cc
* src/SimpleLogger.cc
* src/StringFormat.cc
* src/StringFormat.h
* src/Util.cc
* src/option_processing.cc
* src/version_usage.cc
* test/StringFormatTest.cc
* src/*.h: The classes that has const Logger* as a member variable.
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}