Added gzip, deflate decoding support in HTTP using libz. If
compiled
with this feature, aria2 sends "Accept-Encoding: deflate, gzip"
header
to a HTTP server. If a server returns "Content-Encoding: gzip"
or
"Content-Encoding: deflate" then, aria2 decodes the response
body on the
fly and writes decoded data to a local disk.
* README
* README.html
* configure.ac
* m4/aria2_arg.m4: Added ARIA2_ARG_WITH and ARIA2_ARG_ENABLE,
they are
wrapper function for AC_ARG_WITH and AC_ARG_ENABLE respectively.
* m4/libz.m4
* src/Decoder.h
* src/DownloadCommand.cc
* src/DownloadCommand.h
* src/Exception.h
* src/GZipDecoder.cc
* src/GZipDecoder.h
* src/HttpHeader.cc
* src/HttpHeader.h
* src/HttpRequest.cc
* src/HttpRequest.h
* src/HttpResponse.cc
* src/HttpResponse.h
* src/HttpResponseCommand.cc
* src/Makefile.am
* test/GZipDecoderTest.cc
* test/HttpRequestTest.cc
* test/HttpResponseTest.cc
* test/Makefile.am
* test/Makefile.in
* test/gzip_decode_test.gz
Updated README. Added html version of README and man page.
* README
* README.html
* readme2html: Shell script to generate README.html from README
using
asciidoc.
* doc/aria2c.1.html
* doc/makeman: Added the line to generate aria2c.1.html
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.
* 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
* src/Xml2MetalinkProcessor.h
(xpathExists): New function.
* src/Xml2MetalinkProcessor.cc
(xpathExists): New function.
Not to send HEAD request if filename and size are available in
Metalink
file:
* src/UrlRequestInfo.h
(filename): New variable.
(totalLength): New variable.
(setTotalLength): New function.
(setFilename): New function.
* src/MetalinkRequestInfo.cc
(execute): Set filename and size to UrlRequestInfo.
* src/MetalinkEntry.cc
(MetalinkEntry): Initialize size with 0.
* src/UrlRequestInfo.cc
(execute): Set filename and size to SegmentMan.
Not to download rest of the files after selected files are
downloaded
in BitTorrent:
* src/PieceStorage.h
(allDownloadFinished): New function.
* src/DefaultBtAnnounce.cc
(isCompleteAnnounceReady): Use allDownloadFinished instead of
downloadFinished.
(getAnnounceUrl): Use allDownloadFinished instead of
downloadFinished.
* src/DefaultPieceStorage.cc
(completePiece): Use allDownloadFinished instead of
downloadFinished.
Commented out the call to finishSelectiveDownloadingMode().
(downloadFinished): Call isFilteredAllBitSet() instead of
isAllBitSet().
(allDownloadFinished): New function.
* src/DefaultBtInteractive.cc
(addBitfieldMessageToQueue): Call allDownloadFinished() instead
of
downloadFinished().
(checkHave): Call allDownloadFinished() instead of
downloadFinished().
* src/TorrentDownloadEngine.cc
(onEndOfRun): Call allDownloadFinished() instead of
downloadFinished().
* src/BitfieldMan.h
(isFilteredAllBitSet): New function.
* src/ShareRatioSeedCriteria.h
(PieceStorage.h): New include.
(pieceStorage): New variable.
(evaluate):
btContext->getTotalLength() ->
pieceStorage->getCompletedLength()
* src/BitfieldMan.cc
(isFilteredAllBitSet): New function.
(isAllBitSet): Filter is not took into account.
Rename --force-truncate as --allow-overwrite:
* src/TorrentRequestInfo.cc
(execute): PREF_FORCE_TRUNCATE -> PREF_ALLOW_OVERWRITE
* src/main.cc
(showUsage): --force-truncate -> --allow-overwrite
* src/message.h
(EX_FILE_ALREADY_EXISTS): --force-truncate -> --allow-overwrite
* src/prefs.h
(PREF_FORCE_TRUNCATE): Removed.
(PREF_ALLOW_OVERWRITE): New definition.
* src/SegmentMan.cc
(shouldCancelDownloadForSafety): --force-truncate ->
--allow-overwrite
* src/MetalinkRequestInfo.cc
(execute): Queueing message are now logged in info level.
* src/common.h
(LONG_LONG_MAX): Removed.
(LONG_LONG_MIN): Removed.
* src/HttpResponseCommand.cc
(handleDefaultEncoding): LONG_LONG_MAX -> INT64_MAX
* src/FtpNegotiateCommand.cc
(recvSize): LONG_LONG_MAX -> INT64_MAX
* src/main.cc
(showUsage): Added --check-integiry and
--realtime-chunk-checksum
command-line option.
(main): Added --check-integiry and --realtime-chunk-checksum
command-line option.
--force-truncate -> --allow-overwrite
Set initial value of --check-integrity option to false.
Don't show usage when error occurs while persing command-line
options.
Removed deprecated --upload-limit option.
Added ENABLE_MESSAGE_DIGEST to skip checksum checking when the
message
digest support is not available.
* src/MetalinkEntry.cc
(check): Added ENABLE_MESSAGE_DIGEST. Return true if the message
digest
support is not available.
* src/PeerAbstractCommand.h
(beforeSocketCheck): Removed.
* src/PeerAbstractCommand.cc
Modified in order to call executeInternal() even if socket check
and upload limit check fail.
* src/PeerInteractionCommand.h
(keepAlive): Removed.
(sendKeepAlive): New function.
(checkHave): New function.
(beforeSocketCheck): Removed.
* src/PeerInteractionCommand.cc
(executeInternal): Use peerInteraction->checkRequestSlot().
Added
calls to checkHave() and sendKeepAlive().
(keepAlive): Renamed to sendKeepAlive().
(sendKeepAlive): New function.
(beforeSocketCheck): Removed.
(checkHave): New function.
* src/BitfieldMan.cc
(getMissingIndex): Don't call getMissingIndexRandomly() if max
is 0.
(getMissingUnusedIndex): Don't call getMissingIndexRandomly() if
max is
0.
(getMissingIndex): Dont't call getMissingIndexRandomly() if max
is 0.
* src/TorrentMan.h
(UsedPieces): Removed.
(Pieces): New type definition.
* src/Piece.h: Updated doc.
* src/Peer.h
(totalLength): Removed.
* src/Peer.cc
(updateLatency): Fixed the latency calculation.
* src/TorrentMan.cc
(addPeer): Call deleteOldErrorPeers() only if peers.size() is
higher
than or equal to MAX_PEER_LIST_SIZE.
If duplicate is false and peer.size() >= MAX_PEER_LIST_SIZE,
then return false.
(deleteOldErrorPeers): Rewritten.
(deleteUsedPiece): Fixed the miss use of STL remove.
* src/PeerInteraction.h
(Pieces): Removed.
(deleteTimeoutRequestSlot): Removed.
(deleteCompletedRequestSlot): Removed.
(checkRequestSlot): New function.
* src/PeerInteraction.cc
(deleteTimeoutRequestSlot): Merged to checkRequestSlot().
(deleteCompletedRequestSlot): Merged to checkRequestSlot().
(checkRequestSlot): New function.
* src/DownloadEngine.cc
(run): Clear activeSockets before calling waitData().
(waitData): Removed a call to activeSockets.clear().
To add a readout of estimated remaining time to normal HTTP/FTP
downloads:
* src/ConsoleDownloadEngine.h (startup): New variable.
(startupLength): New variable.
(isStartupLengthSet): New variable.
(avgSpeed): New variable.
(eta): New variable.
* src/ConsoleDownloadEngine.cc (sendStatistics): Added a readout
of
estimated remaining time.
(initStatistics): Initialized newly added variables.
(calculateStatistics): Calculate average speed and estimated
remaining
time.
To decouple TorrentDownloadEngine from HttpResponseCommand:
* src/TrackerDownloadCommand.h: Removed.
* src/TrackerDownloadCommand.cc: Removed.
* src/TrackerInitCommand.h: Removed.
* src/TrackerInitCommand.cc: Removed.
* src/TrackerUpdateCommand.h: Removed.
* src/TrackerUpdateCommand.cc: Removed.
* src/TrackerWatcherCommand.cc (execute): The construction of
request
url written in TrackerInitCommand was moved here. Do not create
tracker request command if torretnMan->trackers != 0.
* src/CompactTrackerResponseProcessor.h: New class.
* src/CompactTrackerResponseProcessor.cc: New class.
* src/message.h (MSG_TRACKER_WARNING_MESSAGE): Updated.
* src/HttpResponseCommand.cc (createHttpDownloadCommand):
Decoupled TorrentDownloadEngine from this.
* src/SegmentMan.h (init): New function.
* src/SegmentMan.cc (init): New function.
* src/TorrentMan.h (responseProcessor): New variable.
(trackers): New variable.
(setTrackerResponseProcessor): New function.
(getTrackerResponseProcessor): New function.
(processTrackerResponse): New function.
* src/TorrentMan.cc (Constructor): Initialized new variable
trackers.
(processTrackerResponse): New function.
* src/main.cc (main): Use ByteArrayDiskWriter and
CompactTrackerResponseProcessor.
* src/TorrentDownloadEngine.cc (afterEachIteration): Call
torrentMan->
processTrackerResponse().
* src/TorrentConsoleDownloadEngine.cc (printStatistics): Updated
a
readout.
* src/TorrentDownloadEngine.cc (afterEachIteration): Added log
message
which indicates download has completed.
* src/AbstractDiskWriter.cc (Destructor): fd >= 0, not fd >0
(closeFile): fd >= 0, not fd > 0
* src/main.cc (main): Added short cut for show-files.
Added short cut for torrent-file.
Added new command-line option listen-port.
Updated i18n messages.
To print ETA:
* src/TorrentDownloadEngine.cc (afterEachIteration): Added
download
completion handling when dealing with
TorrentMan::isPartialDownloadingMode() == true.
* src/TorrentDownloadEngine.h (onPartialDownloadingCompletes):
New function.
* src/TorrentConsoleDownloadEngine.h (startup): New variable.
(sessionDownloadLength): New variable.
(avgSpeed): New variable.
(eta): New variable.
* src/TorrentConsoleDownloadEngine.cc (initStatistics):
Initialized
new variables: eta, avgSpeed, startup.
(calculateSpeed): Calculate average speed and ETA.
(printStatistics): Added ETA.
* src/Util.h (secfmt): New function.
* src/Util.cc (secfmt): New function.
2006-04-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
To detect "keep alive" flooding:
* src/PeerInteractionCommand.h (keepAliveCount): New variable
* src/PeerInteractionCommand.cc (Constructor): Initialized new
variable: keepAliveCount.
(detectMessageFlooding): Added "keep alive" flooding detection.
(receiveMessage): Increase keepAliveCount when "keep alive"
message
received.
To add the ability to download only specified files in
multi-file
torrent:
* src/BitfieldMan.h (filterBitfield): New variable.
(filterEnabled): New variable.
(setFilterBit): New function.
(enableFilter): New function.
(disableFilter): New function.
(isFilterEnabled): New function.
(getFilteredTotalLength): New function.
(getCompletedLength): New function.
* src/BitfieldMan.cc (Constructor): Initialized new variable:
filterBitfield, filterEnabled.
(CopyConstructor): Added filterBitfield and filterEnabled.
(operator==): Added filterBitfield and filterEnabled.
(Destructor): Added filterBitfield.
(getMissingIndex): Use filterBitfield.
(getMissingUnusedIndex): Use filterBitfield.
(getFirstMissingUnusedIndex): Use filterBitfield.
(getFirstMissingUnusedIndex): Use filterBitfield.
(getAllMissingIndexes): Use filterBitfield.
(countMissingBlock): Use filterBitfield.
(countBlock): Use filterBitfield.
(setBitInternal): Added new argument on.
(setUseBit): Use setBitInternal.
(unsetUseBit): Use setBitInternal.
(setBit): Use setBitInternal.
(unsetBit): Use setBitInternal.
(isAllBitSet): Use filterBitfield.
(setFilterBit): New function.
(addFilter): New function.
(enableFilter): New function.
(disableFilter): New function.
(clearFilter): New function.
(isFilterEnabled): New function.
(getFilteredTotalLength): New function.
(getCompletedLength): New function.
* src/TorrentMan.h [FileEntry](Constructor): Updated signature.
Initalized newly added variables.
[FileEntry](offset): New variable.
[FileEntry](extracted): New variable.
[FileEntry](requested): New variable.
(readFileEntry): New function.
(option): New variable.
(splitMultiFile): Removed const qualifier.
(fixFilename): Removed const qualifier.
(readFileEntryFromMetaInfoFile): New function.
(finishPartialDownloadingMode): New function.
(isPartialDownloadingMode): New function.
(setFileEntriesToDownload): New function.
(getCompletedLength): New function.
(getPartialTotalLength): New function.
* src/TorrentMan.cc (readFileEntry): New function.
(setup): Use readFileEntry. If no-preallocation option is
specified,
use DefaultDiskWriter.
(readFileEntryFromMetaInfoFile): New function.
(fixFilename): Removed const qualifier.
(splitMultiFile): Removed const qualifier.
(setFileEntriesToDownload): New function.
(isPartialDownloadingMode): New function.
(finishPartialDownloadingMode): New function.
(getCompletedLength): New function.
(getPartialTotalLength): New function.
* src/TorrentConsoleDownloadEngine.h
(partialDownloadLengthDiff):
New variable.
(partialTotalLength): New variable.
(downloadLength): New variable.
(totalLength): New variable.
* src/TorrentConsoleDownloadEngine.cc
(onPartialDownloadingCompletes):
Added log.
(initStatistics): Initialized new variables:
partialDownloadLengthDiff,
partialTotalLength, downloadLength, totalLength.
(calculate): Calculate downloadLength and totalLength.
* src/prefs.h :New definition PREF_NO_PREALLOCATION
* src/main.cc (addCommand): Changed argument signature.
(main): Added new variable: args. Added new option
"torrent-show-files"
"no-preallocation". Usage is not updated yet.
2006-04-02 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/PeerMessage.cc (setBitfield): Fixed invalid memory
de-allocation.
* configure.in: Added gnutls support. Added several CPP macros.
* m4/openssl.m4: Added.
* src/SocketCore.{h,cc}: Drop const quarifier from writeData(),
readData(), peekData(). Added gnutls support.
* src/HttpDownloadCommand.cc: Removed SleepCommand.h
* src/TrackerWatcherCommand.{h,cc}: Added. This command creates
TrackerInitCommand periodicaly(TorrentMan::minInterval).
* src/TorrentMan.cc: Remove downloadedSize == 0 check from
save().
Instead, added a check for whether setup method has executed
successfully.
* src/TorrentMan.h: Added member vaiable setupComplete. Updated
DEFAULT_ANNOUNCE_INTERVAL and DEFAULT_ANNOUNCE_MIN_INTERVAL to
300.
* src/Makefile.am: Updated.
* src/messageDigest.h: Added. This is a macro calculating SHA1
digest
using whether OpenSSL or gcrypt, depending on the result of
configure
script.
* src/ShaVisitor.{h,cc}: Removed direct dependency on OpenSSL by
using
messageDigest.h.
* src/TorrentAutoSaveCommand.h: Removed unused variable cuid.
* src/PeerListenCommand.cc: Added log about port binded
successfully.
Fixed memory leak.
* src/main.cc: Added gnutls support. Replaced LIB_SSL with
ENABLE_BITTORRENT where they are not related to OpenSSL but
BitTorrent.
Removed instantiation of TrackerInitCommand. Instead,
TrackerWatcherCommand is instantiated and pushed to the command
queue.
* src/InitiateConnectionCommandFactory.cc: Replaced HAVE_LIBSSL
with
ENABLE_SSL.
* src/Request.cc: Replaced HAVE_LIBSSL with ENABLE_SSL.
* src/RequestSlotMan.cc:
(deleteCompletedRequestSlot)
If a piece is already acquired by another command, delete the
request
slots for the piece.
* src/TrackerUpdateCommand.cc:
(execute)
Changed log level of MSG_TRACKER_WARNING_MESSAGE from info to
warn.
Added a check whether peer list is null.
Fixed the bug that causes sending completed event to the tracker
several times.
* src/TrackerInitCommand.cc:
(execute)
Fixed the bug that causes sending completed event to the tracker
several times.
* src/AbstractDiskWriter.{h,cc}: Removed direct dependency on
OpenSSL
by using messageDigest.h.
2006-03-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* PeerConnection.cc: Replaced log message "keep-alive" with
"keep alive".
* PeerInteractionCommand.{h,cc}: Close connection if peer is
choking
localhost long time.
* TorrentMan.cc: When adding new peer with duplicate = true, if
the
number of peer list is equal to or grater than MAX_PEER_LIST,
delete
at most 100 failure entry from the list. If with duplicate =
false,
MAX_PEER_LIST is not checked.
* PeerListenCommand.cc: Fixed the argument order of log message.
2006-03-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* Logger.h: Moved enum LEVEL from SimpleLogger.h to here.
Added warn().
* SimpleLogger.h: Moved enum LEVEL to Logger.h.
Implemented warn().
Defined 2 macros(WRITE_LOG, WRITE_LOG_EX) to avoid duplicated
code.