Now auto protocol detection is enabled without -Z option.
But there is a important difference between with/without -Z optoin.
For example, if you type:
aria2c http://host/file file1.torrent file2.metalink http://mirror/file
then, aria2 interprets there are 3 request groups:
(1) http://host/file, http://mirror/file <-- multi-source download
(2) file1.torrent
(3) file2.metalink
On the other hand, if you invoke above command with -Z option, it is
interpreted as 4 request groups:
(1) http://host/file
(2) file1.torrent
(3) file2.metalink
(4) http://mirror/file
I think usually user don't mix multi-source URLs and torrent files, so
there is no big problem here.
* src/main.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.
Log error in AccRequestGroup when reading BitTorrent/Metalink
file is
failed. Also fixed memory link when exception is thrown there.
* src/main.cc (AccRequestGroup)
Added build-in "Accept-Feature" support. For now only "metalink" is
used in this header field.
This "metalink" value is removed from the list when connecting URLs
fed by metalink file to avoid loop in "transparent" metlaink.
* src/HttpRequest.cc
* src/HttpRequest.h: Renamed _userHeaders as _headers. Accept-Feature
header is also held in this variable. Also renamed setUserHeaders as
addHeader and it was rewritten to add header not just to clear the old
value.
* src/HttpRequestCommand.cc
* src/Metalink2RequestGroup.cc: Added the code to remove "metalink"
from "Accept-Feature" list.
* src/RequestGroup.cc: Added "metalink" to "Accept-Feature" by default.
* src/RequestGroup.h
* src/TaggedItem.cc: Moved Concat class to a2functional.h.
* src/a2functional.h: Included <string> because Concat class depends on
it.
* test/HttpRequestTest.cc
Use the default value pulled from Option object in
HelpItemFactory.
except options whose defualt value is embedded in a usage text.
* src/HelpItemFactory.cc
* src/HelpItemFactory.h
* src/option_processing.cc
* src/version_usage.cc
Added --quiet option to make aria2 quiet (no console output).
--quiet option is tagged with ADVANCED.
* src/HelpItemFactory.cc
* src/LogFactory.cc
* src/LogFactory.h
* src/MultiUrlRequestInfo.cc
* src/MultiUrlRequestInfo.h
* src/NullStatCalc.h: New class. This class prints nothing.
* src/OptionHandlerFactory.cc
* src/main.cc
* src/option_processing.cc
* src/prefs.h
* src/usage_text.h
Reuse socket if the origin server supports HTTP keep-alive and
--enable-http-keep-alive or --enable-http-pipelining is given.
The current implementation doesn't reuse the connections
established
against proxy server.
* src/AbstractCommand.cc
* src/DownloadEngine.cc
* src/DownloadEngine.h
* src/HttpDownloadCommand.cc
* src/HttpInitiateConnectionCommand.cc
* src/HttpResponseCommand.cc
Call FileAllocationMan::nextFileAllocationEntryExists() first.
Calling FileAllocationMan::isFileAllocationBeingExecuted() is
somwhat
waste of time because it is more likey false.
* src/FileAllocationDispatcherCommand.cc (execute)
Now HTTP status and version are a member variable of HttpHeader.
HTTP status is processed as a string, not integer.
* src/AbstractProxyResponseCommand.cc
* src/HttpConnection.cc
* src/HttpHeader.cc
* src/HttpHeader.h
* src/HttpHeaderProcessor.cc
* src/HttpHeaderProcessor.h
* src/HttpResponse.cc
* src/HttpResponse.h
* test/HttpHeaderProcessorTest.cc
* test/HttpResponseTest.cc
Eliminates the time lag between sequential downloads and
commands in
the same RequestGroup.
In old implementation, aria2 occasionally waits 1 seconds before
executing next command or RequestGroup.
This is really a waste of time, and new implementation
eliminates
this unnecessary time lag.
* src/AbstractCommand.cc
* src/AutoSaveCommand.cc
* src/CheckIntegrityCommand.cc
* src/Command.{cc, h}
* src/DownloadEngine.{cc, h}
* src/DownloadEngineFactory.cc
* src/FileAllocationCommand.cc
* src/FileAllocationDispatcherCommand.cc
* src/FillRequestGroupCommand.cc
* src/FtpInitiateConnectionCommand.cc
* src/HaveEraseCommand.cc
* src/HttpInitiateConnectionCommand.cc
* src/HttpResponseCommand.cc
* src/RealtimeCommand.cc
* src/RequestGroup.cc
* src/RequestGroupMan.cc
* src/StreamFileAllocationEntry.cc
* src/TimeBasedCommand.{cc, h}
* src/TimedHaltCommand.cc
Rewritten SharedHandle. Now copy constructor taking raw pointer
has
keyword explicit and SharedHandle's default constructor
initializes
its internal obj to null, old implementation initializes it
using
obj's default constructor.
To assign null, write SharedHandle<T> x(...); x.reset();
TODO: test/SharedHandleTest.cc needs more tests.
* src/SharedHandle.h
Implemented auto protocol detection.
Now you can do:
aria2c -Z http://host/file file1.torrent file2.metalink
(Note: -Z option is required for auto protcol detection.)
Then aria2c downloads 3 files simultaneously:
1. http://host/file
2. file1.torrent <-- read local torrent file
3. file2.metalink <-- read local Metalink file.
Same thing goes with -i option. Assume your uris.txt contans:
http://host/file
file1.torrent
file2.metalink
Then you can do: aria2c -i uris.txt
(Note: -Z option is not needed if -i option is given.)
* src/main.cc
* src/ProtocolDetector.{cc, h}
* test/ProtocolDetectorTest.cc
Renamed argument from 'errno' to 'err', since errno is confused
with
errno defined in errno.h.
* src/LibgcryptARC4Decryptor.h
* src/LibgcryptARC4Context.h
* src/LibgcryptDHKeyExchange.h
* src/LibgcryptARC4Encryptor.h
Now download line is printed nicely with no garbage at the end
of
line. I use ioctl to get the columns of terminal.
If stdout is redirected to another device, instead of carriage
return,
end of line '\n' character is used. This is feature
request#1909659
* src/ConsoleStatCalc.cc (calculateStat)
Fixed high memory footprint when DHT is enabled.
This is not a memory leak, but DHTReplaceNodeTask is more frequently
queued than it is processed and the queue is getting longer. As a
consequence, momory usage is increased.
As for a fix, instead of issuing DHTReplaceNodeTask, I've implemented
replacement cache in DHTBucket which is described in Kademlia paper.
* src/DHTRoutingTable.cc (addNode): Removed the issuing of
DHTReplaceNodeTask.
* src/DHTBucket.{h, cc}
(cacheNode): New function.
(getCachedNodes): New function.
(dropNode): Push back cached node to _nodes.
* test/DHTBucketTest.cc
(testCacheNode): New test
(testDropNode): New test
* src/Util.{h, cc}
(parseUInt): New function.
(alphaToNum): Now returns unsigned int and 0 when overflow
detected.
The actual range is uint32_t.
* test/UtilTest.cc
* src/ParameterizedStringParser.cc:
Use Util::parseUInt() for loop variables.
* test/ParameterizedStringParserTest.cc
* src/PStringNumLoop.h: Make _startValue and _endValue unsigned
int.
Type clarification
* src/PeerSessionResource.{h, cc}
* src/DefaultPieceStorage.{h, cc}
* src/Peer.{h, cc}
* test/PeerSessionResourceTest.cc
Use div function
* src/BtPieceMessage.cc (erasePieceOnDisk)
Fixed compilation error with --disable-nls
It seems that defining gettext(Msgid) to ((const char *)
(Msgid))
in gettext.h causes the problem.
* src/common.h