Added .cc file for classes/structs that only provided by header
file. Defined non-POD classes' ctor, dtor in .cc file. Moved
implementation code in header file to .cc file for major
classes/strucsts.
Implemented getVersion xml-rpc method. This method returns struct
which has 2 key-value pairs: "version" key is associated to the
version of aria2, such as "1.5.0". "enabledFeatures" key is
associated to the list of enabled features, such as "Async DNS",
"BitTorrent".
* src/FeatureConfig.h
* src/XmlRpcMethodFactory.cc
* src/XmlRpcMethodImpl.cc
* src/XmlRpcMethodImpl.h
* test/XmlRpcMethodTest.cc
Reorganized version information so that it can be displayed in a
standard terminal screen without scrolling.
Removed http, ftp from Configuration section, because they are
always
enabled.
* src/FeatureConfig.cc
* src/FeatureConfig.h
* src/main.cc
* src/messageDigest.cc
* src/messageDigest.h
* src/version_usage.cc
* test/FeatureConfigTest.cc
* src/Option.h
(getAsBool): New function.
* src/Option.cc
(prefs.h): Included.
(defined): 0-length value is now recognized as undefined.
(getAsInt): Rewritten.
(getAsLLInt): Rewritten.
(getAsBool): New function.
* src/FeatureConfig.h: Rewritten.
* src/FeatureConfig.cc: Rewritten.
* src/prefs.h
(PREF_STDOUT_LOG): New definition.
(PREF_LOG): New definition.
(PREF_DIR): New definition.
(PREF_OUT): New definition.
(PREF_SPLIT): New definition.
(PREF_DAEMON): New definition.
(PREF_REFERER): New definition.
(PREF_TORRENT_FILE): New definition.
(PREF_LISTEN_PORT): New definition.
(PREF_METALINK_FILE): New definition.
(PREF_METALINK_VERSION): New definition.
(PREF_METALINK_LANGUAGE): New definition.
(PREF_METALINK_OS): New definition.
(PREF_METALINK_SERVERS): New definition.
* src/main.cc
(main): Following command-line parameters are now put into
Option
class: stdoutLog, logfile, dir, ufilename, split, daemonMode,
referer, torrentFile, metalinkFile, listenPort, metalinkVersion,
metalinkLanguage, metalinkOs, metalinkServers
To fix the bug that aria2 can not handle http response header
properly.
* src/HttpHeader.cc
(put): Made name lowercased.
(defined): Made name lowercased.
(getFirst): Made name lowercased.
(get): Made name lowercased.
(getFirstAsInt): Rewritten.
(getFirstAsLLInt): Rewritten.
* src/TorrentMan.h:
(advertisePiece): Updated doc.
(getAdvertisedPieceIndexes): Updated doc.
(removeAdvertisedPiece); New function.
* src/TorrentMan.cc
(FindElapsedHave): New function object.
(removeAdvertisedPiece): New function.
* src/HaveEraseCommand.h: New class.
* src/HaveEraseCommand.cc: New class.
* src/FeatureConfig.h: New class.
* src/FeatureConfig.cc: New class.
* src/Request.h
(defaultPorts): Removed.
* src/Request.cc
(FeatureConfig.h): Included.
(Request): Removed the statements related to defaultPorts.
(parseUrl): Removed metalinkEnabled. Use FeatureConfig instead.
A default port number is now retrieved from FeatureConfig.
* src/main.cc
(HaveEraseCommand.h): Included.
(showVersion): Added the output of feature list.
(main): Added HaveEraseCommand to command queue in BitTorrent
downloading.
* src/PeerInteractionCommand.h
(chokeCheckPoint): Commented out.
(periodicExecPoint): New variable.
* src/PeerInteractionCommand.cc
(executeInternal): Following methods are now called in at least
every
0.5 seconds to reduce CPU usage:
detectMessageFlooding(), peerInteraction->checkRequestSlot(),
checkHave(), sendKeepAlive().
(checkLongTimePeerChoking): Commented out.
* src/BitfieldMan.h
(getNthBitIndex): Changed the method signature.
(getMissingIndexRandomly): Changed the method signature.
* src/BitfieldMan.cc
(getNthBitIndex): Rewritten
(getMissingIndexRandomly): Rewritten.
(hasMissingPiece): Rewritten.
(getMissingIndex): Refactored.
(getMissingUnusedIndex); Refactored.
(getMissingIndex): Refactored.