Commit Graph

137 Commits (b1695a65c022f938f0e74a9b416449dd29b85563)

Author SHA1 Message Date
Tatsuhiro Tsujikawa 4b5ad58219 2007-12-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed compilation warnings
	* test/DataTest.cc
	* test/HttpRequestTest.cc
	* test/MetaFileUtilTest.cc
	* test/RequestTest.cc
2007-12-08 16:57:32 +00:00
Tatsuhiro Tsujikawa 7bf2c7751f Corrected comment 2007-12-08 10:49:20 +00:00
Tatsuhiro Tsujikawa bb4bff2c2a 2007-12-07 Tatsuhiro Tsujikawa <tujikawa at rednoah com>
Fixed the bug#1845750; CTRL+C does not stop torrent.
	aria2 repeatedly sends stopped request when tracker returns error code.
	* src/AnnounceList.cc
	* test/AnnounceListTest.cc
	* src/AnnounceTier.h

	Added a message when ctrl-c is hit.
	Now second ctrl-c is also handled in signal handler.
	* src/RequestGroupMan.{h, cc}
	* src/RequestGroup.{h, cc}
	* src/MultiUrlRequestInfo.cc
	* src/DownloadEngine.cc
	* src/TrackerWatcherCommand.cc
2007-12-07 13:33:59 +00:00
Tatsuhiro Tsujikawa 30739b0763 2007-12-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug: aria2 doesn't utilize fast set index offered by peer.
	* src/Peer.{h, cc}
	* src/DefaultPieceStorage.cc
	* test/DefaultPieceStorageTest.cc
2007-12-05 17:57:08 +00:00
Tatsuhiro Tsujikawa 0ec3727bf5 2007-12-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed compile error without message digest support.
	* src/FileMetalinkParserState.cc
	* src/MetalinkParserController.{h, cc}
	* test/XML2SAXMetalinkProcessorTest.cc
	* test/MetalinkParserControllerTest.cc
2007-12-05 14:54:53 +00:00
Tatsuhiro Tsujikawa b75dbc4bbe 2007-12-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Enable direct I/O support in checksum checking.
	* src/IteratableChunkChecksumValidator.{h, cc}
	* test/IteratableChunkChecksumValidatorTest.cc
	* src/CheckIntegrityEntry.cc
	* src/PieceHashCheckIntegrityEntry.cc
	* src/IteratableChecksumValidator.{h, cc}
	* src/BtCheckIntegrityEntry.cc: Added doc.
2007-12-05 13:41:56 +00:00
Tatsuhiro Tsujikawa 24bdbf9aa6 2007-12-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added --allow-piece-length-change option.
	* src/DefaultBtProgressInfoFile.cc
	* test/DefaultBtProgressInfoFileTest.cc
	* src/OptionHandlerFactory.cc
	* src/option_processing.cc
	* src/prefs.h
	* src/version_usage.cc
	* doc/aria2c.1.txt
	* doc/aria2c.1
	
	Fixed: duplicated result entry appears when exception is thrown 
in
	RequestGroup::createInitiateConnectionCommand().
	* src/RequestGroupMan.cc (fillRequestGroupFromReserver):
	Add RequestGroup to _requestGroup after RequetGroup::
	createInitiateConnectionCommand() succeeds.

	Externalized  message
	* src/XML2SAXMetalinkProcessor.cc
	* src/message.h
2007-12-04 14:52:46 +00:00
Tatsuhiro Tsujikawa 936ce09b83 2007-12-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added XML2SAXMetalinkProcessor class, which is a lot faster than
	the predecessor, Xml2MetalinkParser class.
	I tested them against 94KB metalink file with 1234 chunk 
checksums.
	The new one parsed it in 22msec, while it took 6000msec with old 
one.
	* src/XML2SAXMetalinkProcessor.{h, cc}
	* test/XML2SAXMetalinkProcessorTest.cc
	* src/MetalinkParserController.{h, cc}
	* test/MetalinkParserControllerTest.cc
	* src/MetalinkParserState.h: Also added 16 subclasses.
	* src/main.cc
	* src/Metalink2RequestGroup.cc
	* src/MetalinkHelper.cc
	* src/MetalinkEntry.cc
	* src/ChunkChecksum.h
	
	Rewritten Base64 class for better performance.
	* src/Base64.{h, cc}
	* test/Base64Test.cc
	* src/HttpRequest.cc
2007-12-04 11:12:56 +00:00
Tatsuhiro Tsujikawa 4a59e5899a 2007-11-29 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Eliminated g++-4.2 warning
	* src/DownloadHandlerConstants.{h, cc}
	* src/Util.cc
	* test/MetaFileUtilTest.cc
	* test/PStringBuildVisitorTest.cc
	
	Fixed bug: --check-integrity dones't work for multi file 
torrent.
	* src/RequestGroup.cc
	* src/BtCheckIntegrityEntry.cc
2007-11-29 11:33:50 +00:00
Tatsuhiro Tsujikawa 5a2f398eca 2007-11-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added direct I/O support. The current implementation uses O_DIRECT,
	which is not posix standard and is tested on linux 2.6.21.
	Currently only file allocation uses direct I/O.
	* src/SingleFileAllocationIterator.{h, cc}
	* test/SingleFileAllocationIteratorTest.cc
	* src/MultiFileAllocationIterator.{h, cc}
	* test/MultiFileAllocationIteratorTest.cc
	* src/BinaryStream.h
	* src/DiskWriter.h
	* src/AbstractDiskWriter.{h, cc}
	* src/ByteArrayDiskWriter.h
	* src/DiskAdaptor.h
	* src/AbstractSingleDiskAdaptor.{h, cc}
	* src/MultiDiskAdaptor.{h, cc}
	* src/FileAllocationEntry.cc
	* src/Util.{h, cc}
	* src/OptionHandlerFactory.cc
	* src/prefs.h
	* src/version_usage.cc
	* src/option_processing.cc

	Moved FileAllocationMan::markCurrentFileAllocationEntryDone() to
	handleException.
	* src/MultiFileAllocationIterator.cc

	Added EINTR handling
	* src/SocketCore.cc
2007-11-28 14:22:28 +00:00
Tatsuhiro Tsujikawa fac8e1d273 2007-11-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Set Content-Type to SingleFileDownloadContext when http response 
is
	received.
	* src/HttpResponseCommand.cc
	* src/HttpResponse.{h, cc}
	* test/HttpResponseTest.cc
2007-11-27 12:45:29 +00:00
Tatsuhiro Tsujikawa 506bc3db13 2007-11-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Rewritten to add content-type support.
	* src/DownloadHandler.{h, cc}
	* src/BtPostDownloadHandler.{h, cc}
	* test/BtPostDownloadHandlerTest.cc
	* src/MetalinkPostDownloadHandler.{h, cc}
	* test/MetalinkPostDownloadHandlerTest.cc
	* src/PostDownloadHandler.{h, cc}
	* src/DownloadHandlerConstants.{h, cc}
	* src/RequestGroup.cc
	* src/HttpResponseCommand.cc
	* src/FtpNegotiationCommand.cc
	* src/SingleFileDownloadContext.{h, cc}
	* src/RequestGroup.h
	* src/RequestGroupCriteria.h
	* src/ContentTypeRequestGroupCriteria.h

	Added 'mem' option value for --follow-metalink, 
--follow-torrent.
	If it is give, metalink/torrent file is not written to the disk, 
but
	just is kept in memory. Parsing is occurred on memory.
	* src/MetalinkHelper.{h, cc}
	* src/MetalinkProcessor.h
	* src/Xml2MetalinkProcessor.{h, cc}
	* test/Xml2MetalinkProcessorTest.cc
	* src/DownloadHandlerFactory.{h, cc}
	* test/DownloadHandlerFactoryTest.cc
	* src/PreDownloadHandler.{h, cc}
	* src/OptionHandlerFactory.cc
	* src/DefaultBtContext.{h, cc}
	* test/DefaultBtContextTest.cc
	* src/version_usage.cc
	* src/Metalink2RequestGroup.{h, cc}
	* src/RequestGroup.{h, cc}
	* src/a2functional.h
	* test/a2functionalTest.cc
	* src/MemoryBufferPreDownloadHandler.{h, cc}
	* src/OptionHandlerImpl.h
	* src/prefs.h
	* src/Util.{h, cc}
	* test/UtilTest.cc
	
	Keep DownloadResult rather than RequestGroup after downloads to 
reduce
	memory usage.
	* src/RequestGroupMan.{h, cc}
	* src/DownloadEngine.cc
	* src/BtDependency.{h, cc}: Changed the type of dependee from
	WeakHandle to SharedHandle because WeakHandle could be null.
	* src/RequestGroup.{h, cc}
	* src/DownloadEngineFactory.cc
	* src/DownloadResult.h
	
	Set totalLength after download finished
	* src/UnknownLengthPieceStorage.{h, cc}

	Keep torrent file specified in metalink in memory.
	* src/Metalink2RequestGroup.cc
	* src/BtDependency.cc
	* src/TrueRequestGroupCriteria.h

	Fixed the bug: seekg is used where seekp should be used.
	* src/ByteArrayDiskWriter.cc
	* test/ByteArraydiskWriterTest.cc
2007-11-27 12:27:10 +00:00
Tatsuhiro Tsujikawa 9d66150a83 2007-11-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed syntax error
	* test/SequenceTest.cc
2007-11-25 11:57:17 +00:00
Tatsuhiro Tsujikawa cf59b13193 Updated test/Metakefile.in 2007-11-25 04:42:04 +00:00
Tatsuhiro Tsujikawa 194f45a3c3 2007-11-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Trim announce URL
	* src/DefaultBtContext.cc
	* test/ShaVisitorTest.cc
	
	Trim argument s. Give trimed s to exception constructor.
	* src/Util.cc (parseInt)(parseLLInt)
	* test/UtilTest.cc
2007-11-22 14:44:40 +00:00
Tatsuhiro Tsujikawa 7436490f75 2007-11-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Replaced strtol with Util::parseInt
	* src/ChunkedEncoding.cc
	* src/HttpConnection.cc
	* src/CookieBoxFactory.cc
	* src/ParameterizedStringParser.cc
	* src/Util.cc
	* test/UtilTest.cc
	* test/OptionHandlerTest.cc
	* src/Request.cc

	Throw exception when empty string is given. The message for 
exception
	changed.
	* src/Util.cc (parseInt)(parseLLInt)
	* src/message.h
2007-11-22 11:17:35 +00:00
Tatsuhiro Tsujikawa c9e3d51054 2007-11-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Preallocate non-requested file which is adjacent forward to 
requested
	file('requested' files means the files given in --select-file 
option)
	if they share a same piece.
	This fixes long pause in the file system which doesn't support 
sparse
	files like FAT32 while downloading.
	* src/MultiFileAllocationIterator.{h, cc}
	* test/MultiFileAllocationIteratorTest.cc
	* src/FileEntry.{h, cc}

	Removed unused _option.
	* src/MultiDiskAdaptor.h
	* test/MultiDiskAdaptorTest.cc
	* src/DefaultPieceStorage.cc

	Set the default value of --seed-ratio to 1.0.
	If 0.0 is given, then seeding continues regardless of share 
ratio.
	* src/version_usage.cc
	* src/option_processing.cc
	* src/BtSetup.cc
	* doc/aria2c.1.txt
	* doc/aria2c.1

	Fixed: Selective download is not working in BitTorrent
	* src/RequestGroup.cc

	Introduced Sequence class. Use this instead of 
Util::unfoldRange()
	* src/PieceStorage.h
	* test/MockPieceStorage.h
	* src/UnknownLengthPieceStorage.h
	* src/DefaultPieceStorage.{h, cc}
	* src/Metalink2RequestGroup.cc
	* src/RequestGroup.cc
	* src/Sequence.h
	* test/SequenceTest.cc
	* src/IntSequence.h
	* src/message.h
	* src/Util.{h, cc}
	* test/UtilTest.cc

	Added new function 'parse' to catch exception thrown by 
subclass's
	parseArg
	* src/OptionHandler.h
	* src/OptionParser.cc
	* src/NameMatchOptionHandler.h
	* src/OptionHandlerImpl.h
	* test/OptionHandlerTest.cc

	Added IntegerRangeOptionHandler. Used for --listen-port and
	--select-file. Now --listen-port accepts range of port.
	* src/OptionHandlerFactory.cc
	* src/version_usage.cc
	* src/OptionHandlerImpl.h
	* src/option_processing.cc
	* src/BtSetup.cc
	* src/PeerListenCommand.{h, cc}
	* doc/aria2c.1.txt
	* doc/aria2c.1
	
	Implemented operator< for Exception class to provide easy way to 
print
	exception stack trace.
	* src/Exception.{h, cc}
	* src/main.cc
	* src/option_processing.cc
2007-11-21 16:14:40 +00:00
Tatsuhiro Tsujikawa ab8c0aafeb 2007-11-17 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Implemented. Now -c option works fine.
	* src/DefaultPieceStorage.cc (markPiecesDone)
	* test/DefaultPieceStorageTest.cc

	Removed.
	* src/SegmentMan.{h, cc}
	(markAllPiecesDone)
	(markPieceDone)

	Synchronized po files with 
	https://translations.launchpad.net/aria2/trunk/+pots/aria2c
	* src/fr.po
	* src/ru.po
	* src/de.po
	* src/ja.po
2007-11-17 13:49:36 +00:00
Tatsuhiro Tsujikawa a31dbb5804 2007-11-14 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added ifdef and some modifications to compile without 
BitTorrent,
	Metalink, MessageDigest
	support.
	* src/PieceHashCheckIntegrityEntry.cc
	* src/MetalinkEntry.h
	* src/version_usage.cc
	* src/main.cc
	* src/DownloadEngine.{h, cc}
	* src/Metalink2RequestGroup.cc
	* src/Peer.cc
	* src/RequestGroup.cc
	* src/MetalinkHelper.cc
	* test/DefaultPieceStorageTest.cc
	* test/MetalinkPostDownloadHandlerTest.cc
	* test/Metalink2RequestGroupTest.cc

	Hide TOTAL SPD when all downloads complete.
	* src/ConsoleStatCalc.cc

	Log target system information.
	* src/main.cc
2007-11-14 10:10:38 +00:00
Tatsuhiro Tsujikawa 8cba9bc24c 2007-11-13 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Now --metalink-location accepts a comma-deliminated list of 
locations.
	* src/MetalinkEntry.{h, cc}
	* test/MetalinkEntryTest.cc
	* src/version_usage.cc
	* src/Metalink2RequestGroup.cc
	* src/Xml2MetalinkProcessor.cc
	* test/Xml2MetalinkProcessorTest.cc
	* doc/aria2c.1.txt
	* doc/aria2c.1

	* src/Util.cc (toUpper)(toLower): Rewritten.
2007-11-13 13:49:10 +00:00
Tatsuhiro Tsujikawa d6686a5e29 2007-11-13 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Recalculates download progress when loading a control file,
	if the piece length of DownloadContext is different from the one 
saved
	in the control file. Currently in-flight pieces are ignored.
	* src/DefaultBtProgressInfoFile.cc
	* test/DefaultBtProgressInfoFileTest.cc
	* src/Util.{h, cc}
	* test/UtilTest.cc
2007-11-13 10:10:11 +00:00
Tatsuhiro Tsujikawa aef50efed0 2007-11-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Do not rotate tiers in announce-list.
	* src/DefaultBtAnnounce.{h, cc}: Removed trackerNumTry.
	AnnounceList::allTiersFailed() used instead to detect whether 
all
	tiers are tried and failed.
	* test/DefaultBtAnnounceTest.cc
	* src/AnnounceList.{h, cc}: If all tiers are tried and failed 
then
	allTiersFailed() returns true. To reset tier pointer, call 
resetTier();
	* test/AnnounceListTest.cc
	* src/TrackerWatcherCommand.cc (execute): Removed DlAbortEx 
catch
	clause. Catch RecoverableException instead of DlRetryEx instead.
2007-11-12 14:13:00 +00:00
Tatsuhiro Tsujikawa 7c41d11be3 2007-11-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Implemented checksum validation feature(1 checksum for each 
file)
	The validation takes place after the download.
	* src/PieceHashCheckIntegrityEntry.{h, cc}: New class.
	* src/IteratableChecksumValidator.{h, cc}: Rewritten.
	* src/CheckIntegrityCommand.cc: Changed log message.
	* src/Metalink2RequestGroup.cc: Set checksum to
	SingleFileDownloadContext.
	* src/StreamCheckIntegrityEntry.{h, cc}: Now derived from
	PieceHashCheckIntegrity class.
	* src/BtCheckIntegrityEntry.{h, cc}: Now derived from
	PieceHashCheckIntegrity class.
	* src/ChecksumCheckIntegrityEntry.{h, cc}: New class.
	* src/IteratableValidator.h: New class.
	* src/message.h
	* src/CheckIntegrityEntry.{h, cc}
	* src/IteratableChunkChecksumValidator.{h, cc}
	* src/SingleFileDownloadContext.h
	* src/DownloadCommand.cc
	
	--allow-overwrite=true is no longer needed to check file 
integrity
	before download in BitTorrent download.
	* src/RequestGroup.cc (getInitialCommand)

	Removed RequestGroup from queue when 
RequestGroup::getInitialCommand()
	throws exception.
	* src/RequestGroupMan.cc (getInitialCommands)
2007-11-12 11:28:16 +00:00
Tatsuhiro Tsujikawa 4f59dc84bf 2007-11-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
urlencode the given url inside Request::parseUrl(...)
	* src/Request.{h, cc}
	* src/Util.{h, cc}
	* test/RequestTest.cc

	Removed #!metalink3! notation support because it is deleted from
	the metalink specification.
	* src/Request.{h, cc}
	* test/RequestTest.cc
2007-11-11 04:25:56 +00:00
Tatsuhiro Tsujikawa b5ad009809 2007-11-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Don't connect server before checking file integrity at startup, 
if
	filesize and output file path are known.
	* src/AbstractCommand.cc
	* src/StreamFileAllocationEntry.cc
	* src/Metalink2RequestGroup.cc
	* src/RequestGroup.{h, cc}
	* src/HttpResponseCommand.cc
	* src/FtpNegotiationCommand.cc

	Added DownloadFailureException. If it is thrown, RequestGroup 
should
	halt.
	* src/AbstractCommand.cc
	* src/DownloadFailureException.h
	* src/RequestGroup.cc

	Catch RecoverableException, instead of DlAbortEx.
	* src/RequestGroupMan.cc
	* src/FillRequestGroupCommand.cc
	* src/MetaFileUtil.cc
	* src/IteratableChunkChecksumValidator.cc

	Now first parameter of MSG_DOWNLOAD_ABORTED is 
gid(RequestGroup::
	getGID())
	* src/CheckIntegrityCommand.cc
	* src/message.h
	
	Print gid instead of idx.
	* src/RequestGroupMan.cc

	Removed exception throwers declaration.
	* src/DirectDiskAdaptor.{h, cc}
	* src/SocketCore.{h, cc}
	* src/MultiDiskAdaptor.{h, cc}
	* src/HttpConnection.{h, cc}
	* src/HttpResponse.{h, cc}
	* src/DiskAdaptor.{h, cc}
	* src/CopyDiskAdaptor.{h, cc}
	* src/MultiDiskAdaptor.{h, cc}
	* src/HttpHeaderProcessor.{h, cc}
	* src/AbstractSingleDiskAdaptor.{h, cc}
	* src/Util.{h, cc}
	* test/UtilTest.cc
	* src/DefaultDiskWriter.{h, cc}
	* src/FtpConnection.{h, cc}
	* src/AbstractDiskWriter.{h, cc}

	Removed duplicate code.
	* src/StreamCheckIntegrityEntry.cc

	Removed unnecessary include.
	* src/DiskWriter.h

	Included Exception.h
	* src/option_processing.cc

	Included 2 files and added doc
	* src/TrackerWatcherCommand.cc

	* src/SocketCore.cc (writeData): Fixed send error with GnuTLS.
2007-11-09 18:01:12 +00:00
Tatsuhiro Tsujikawa b4f7588ba2 2007-11-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Reflect the download length of in-flight pieces.
	It makes the download length readout more precise.
	* src/DefaultPieceStorage.{h, cc}
	* test/DefaultPieceStorageTest.cc
	* src/a2functional.h
	* test/a2functionalTest.cc
	
	Lower CPU load when --max-download-limit is used.
	There is up and down in speed indicator when enabling
	http-pipelining but a download goes well. I think the problem is 
that
	because http-pipelining is enabled, DownloadCommand is created 
for
	each segment and in its constructor, PeerStat::downloadStart() 
is
	called. In PeerStat::downloadStart(), speed calculation object 
is
	reseted, which makes download speed zero.
	* src/DownloadCommand.cc

	Rewritten using accumulate.
	* src/RequestGroupMan.cc (calculateStat)
	
	Code clearnup.
	* src/FtpNegotiationCommand.cc
	* src/HttpResponseCommand.cc
2007-11-07 12:36:33 +00:00
Tatsuhiro Tsujikawa 52b43151c6 2007-11-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Now a file is stored in the directory specified in .metalnk file
	(file[@name]).
	* src/Metalink2RequestGroup.cc

	Create the directory structure when opening the file if it 
doesn't
	exist.
	* src/AbstractDiskWriter.cc
	* src/Util.{h, cc}
	* src/File.h
	* test/UtilTest.cc
	
	Removed file name comparison
	* src/Metalink2RequestGroup.cc
	* src/HttpResponseCommand.cc

	Rewritten using Util::mkdirs()
	* src/FileEntry.cc (setupDir)
	* test/FileEntryTest.cc
	
	Updated doc
	* src/SingleFileDownloadContext.h
2007-11-05 15:13:55 +00:00
Tatsuhiro Tsujikawa d8ae699182 2007-11-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed: the listen port sent to the tracker is wrong. If aria2 
fails
	to open listen port, then remove the port number from the 
tracker
	request.
	* src/DefaultBtAnnounce.cc 
	* test/DefaultBtAnnounceTest.cc
	* test/MockPieceStorage.h
	
	Inject randomizer to DefaultBtAnnounce and DefaultBtContext to 
make
	them more testable.
	* src/DefaultBtAnnounce.{h, cc}
	* src/DefaultBtContext.{h, cc}
	* src/Util.{h, cc}
	* test/DefaultBtAnnounceTest.cc
	* test/DefaultBtContextTest.cc
	* test/UtilTest.cc
	
	Added 'B' to upload bytes readout.
	* src/ConsoleStatCalc.cc

	Now the listen port for BitTorrent download is opened when it is
	needed.
	* src/DownloadEngineFactory.cc
	* src/BtSetup.{h, cc}
	* src/PeerListenCommand.{h, cc}
	
	Now an exception thrown while parsing tracker response is now 
logged.
	If DlAbortEx is catched, then btAnnounce->resetAnnounce() 
immediately
	called, which means no retry is made in this case, assuming a 
tracker
	has a problem.
	* src/TrackerWatcherCommand.cc
	
	Fixed: downloading a file whose length is unkown fails.
	* src/DownloadCommand.cc

	Simplified prepareForNextSegment()
	* src/DownloadCommand.cc

	Updated
	* po/POTFILES.in
2007-11-04 12:26:12 +00:00
Tatsuhiro Tsujikawa 166f7aa8c2 2007-11-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Re-implemented a file listing for Metalink, which was dropped 
while
	http/ftp/torrent integration was being implemented.
	* src/MetalinkHelper.{h, cc}: New class.
	* test/MetalinkHelperTest.cc
	* src/main.cc
	* src/Metalink2RequestGroup.cc
2007-11-03 12:03:53 +00:00
Tatsuhiro Tsujikawa f9f388af87 2007-11-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added the ability to display the detailed torrent file 
information.
	Now -S option gives not only a file listing, but also total 
download
	length, info hash, announce URI, piece length, the number of 
pieces,
	and mode(single or multi-torrent).
	* src/DefaultBtContext.{h, cc} (operator<<): New function.
	* src/Util.cc (toStream): Show file length in a abbreviated 
form(like
	KiB)
	* test/UtilTest.cc
	* src/main.cc
2007-11-03 08:58:45 +00:00
Tatsuhiro Tsujikawa 6b7df851d3 2007-10-30 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added ftp://USER:PASSWD@Servername automatic parsing.
	* src/Request.{h, cc}: Removed AuthResolvers. Added _username 
and
	_password. Recognize username and password in URI.
	* src/main.cc: Use AuthConfigFactory instead of RequestFactory.
	* src/RequestGroup.cc: Use AuthConfigFactory instead of 
RequestFactory.
	* src/RequestFactory.{h, cc}: Removed.
	* src/AuthConfigFactory.{h, cc}: New class.
	* src/FtpConnection.cc: Use AuthConfigFactory.
	* src/HttpRequest.cc: Use AuthConfigFactory.
	* test/HttpRequestTest.cc: Updated.
	* test/RequestTest.cc: Updated.
	* test/AuthConfigFactoryTest.cc: New class.
	* test/RequestFactoryTest.cc: Removed.
2007-10-30 12:48:01 +00:00
Tatsuhiro Tsujikawa 8b27671e58 2007-10-29 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Use File::renameTo()
	* src/DefaultBtProgressInfoFile.cc

	Added --no-file-allocation-limit command-line option.
        * src/version_usage.cc
	* src/option_processing.cc
        * src/OptionHandlerFactory.cc
        * src/RequestGroup.{h, cc}
	* src/BtCheckIntegrityEntry.cc
	* src/StreamCheckIntegrityEntry.cc
        * src/prefs.h
        * doc/aria2c.1.txt
        * doc/aria2c.1

	Now prealloc is the default value for --file-allocation option.
        * src/version_usage.cc
	* src/option_processing.cc
        * doc/aria2c.1.txt
        * doc/aria2c.1

	Don't URL-encode user-agent.
	* src/HttpRequest.cc

	Updated translations
        * po/LINGUAS: Added nl for Dutch translation.
        * po/nl.po: Added Dutch translation, thanks to A. Bram Neijt.
        * po/de.po: Updated German translation, thanks to Patrick 
Ruckstuhl.
	* po/POTFILES.in: Updated.
2007-10-29 12:43:45 +00:00
Tatsuhiro Tsujikawa 368d53071a 2007-10-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added the ability to recognize url-list in a torrent file.
	The retrieved URLs are attached to the corresponding FileEntry.
	* src/DefaultBtContext.{h, cc}
	* src/FileEntry.{h, cc}
	* test/DefaultBtContextTest.cc
2007-10-27 12:32:14 +00:00
Tatsuhiro Tsujikawa 3ab9fe706d 2007-10-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/Piece.{h, cc}: Added SubPiece infrastructure to track down
	the data smaller than block length.
	A block length can be specified by constructor's argument.
	* src/DefaultPieceStorage.{h, cc} (getMissingPiece):
	Get a missing piece in the range of given FileEntry. This 
function is
	not used in the program yet.
	* src/Util.h: Added some macros.
2007-10-23 16:29:37 +00:00
Tatsuhiro Tsujikawa 884a139e72 2007-10-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added HTTP/1.1 keep alive and pipelining support.
	See --enable-http-keep-alive and --enable-http-pipelining 
option.
	* src/AbstractCommand.{h, cc}: Now it has one-to-many relation 
to
	Segment.
	* src/HttpDownloadCommand.{h, cc}
	* src/OptionHandlerFactory.cc
	* src/HttpConnection.{h, cc}
	* src/version_usage.cc
	* src/HttpInitiateConnectionCommand.cc
	* src/FtpInitiateConnectionCommand.cc
	* src/Segment.h
	* src/HttpRequestCommand.{h, cc}
	* src/option_processing.cc
	* src/prefs.h
	* src/HttpResponseCommand.cc
	* src/SegmentMan.{h, cc}
	* src/FtpNegotiateCommand.cc
	* src/HttpProxyResponseCommand.cc
	* src/Request.cc
	* src/HttpRequest.cc
	* src/DownloadCommand.cc
	* test/HttpRequestTest.cc
	* test/RequestTest.cc
2007-10-17 16:26:51 +00:00
Tatsuhiro Tsujikawa c0b467273c 2007-10-15 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/Request.cc (parseUrl): Removed unnecessary slashes around 
dir.
2007-10-14 16:29:05 +00:00
Tatsuhiro Tsujikawa 1171a2063f 2007-10-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Throw exception when chunck checksum verification fails.
	* src/DownloadCommand.cc (validatePieceHash): New function.
	* src/PiecedSegment.{h, cc} (clear): New function.
	* src/GrowSegment.{h, cc} (clear): New function.
	* src/Segment.h (clear): New function.
	* src/SegmentMan.{h, cc} (validatePieceHash): Removed.
	* test/SegmentTest.cc
	* test/GrowSegmentTest.cc
2007-10-12 15:11:37 +00:00
Tatsuhiro Tsujikawa 1d5834a6ca 2007-10-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Do not send referer when redirected.
	* src/Request.cc (redirectUrl)
	* test/RequestTest.cc
	* test/HttpRequestTest.cc
2007-10-11 17:04:53 +00:00
Tatsuhiro Tsujikawa 048a2cf597 2007-10-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Implemented BitTorrent/http/ftp integrated download.
	I've rewritten lots of files and now some headers have forward
	class declarations to reduce compile time.
	The implementation is extremely alpha stage, I recommend to use this
	for testing purpose only.
2007-10-11 16:58:24 +00:00
Tatsuhiro Tsujikawa e26bbbb9ee Merged stable-0.11 branch changes r15 into the trunk. 2007-09-13 15:08:02 +00:00
Tatsuhiro Tsujikawa 41f82862d7 Merged stable-0.11 branch changes r13 into the trank. 2007-09-12 14:53:18 +00:00
Tatsuhiro Tsujikawa 57471aac9c 2007-09-02 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Now *.aria2 contorol file is first saved to *.aria2__temp and if
	it is successful, then renamed to *.aria2.
	This prevents *.aria2 file from being truncated	or corrupted 
when
	file system becomes out of space.
	* src/DefaultBtProgressInfoFile.cc (save)
	* src/SegmentMan.cc (save)
	* test/DefaultBtProgressInfoFileTest.cc (testSave): Implemented.
2007-09-01 16:10:30 +00:00
Tatsuhiro Tsujikawa 2bea8759c4 2007-09-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Reduced the fragmentation of bitfield in http/ftp download.
	* src/BitfieldMan.cc (getSparseMissingUnusedIndex)
	* test/BitfieldManTest.cc
2007-08-31 15:18:48 +00:00
Tatsuhiro Tsujikawa d1e7a68d68 2007-08-30 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added the ability to disable segmented download in .metalink.
	aria2 can now recognize 'maxconnections' attribute in 
'resources' and
	'url' tag.
	* src/MetalinkEntry.{h, cc}
	* src/RequestResource.{h, cc}
	* src/MetalinkRequestInfo.cc
	* src/Xml2MetalinkProcessor.cc
	* test/Xml2MetalinkProcessorTest.cc
2007-08-30 14:52:46 +00:00
Tatsuhiro Tsujikawa 917e69793c Added new testcase 2007-08-28 15:48:05 +00:00
Tatsuhiro Tsujikawa f8aab322fc 2007-08-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added auto file renaming feature in http(s)/ftp download.
	* src/main.cc: Added --auto-file-renaming command-line option.
	* src/OptionHandlerFactory.cc
	* src/prefs.h: Added PREF_AUTO_FILE_RENAMING
	* src/RequestGroup.{h, cc}
	(shouldCancelDownloadForSafety): Rewritten
	(tryAutoFileRenaming): New function.
	* src/SegmentMan.{h, cc} (shouldCancelDownloadForSafety): 
Removed.
	* src/HttpResponseCommand.cc
	(executeInternal): Removed the call to RequestGroupMan::
	isSameFileBeingDownloaded()
	* src/FtpNegotiateCommand.cc
	(recvSize): Removed the call to RequestGroupMan::
	isSameFileBeingDownloaded()
	* test/RequestGroupTest.cc: New class.
2007-08-28 15:46:49 +00:00
Tatsuhiro Tsujikawa 7fb4336d5e 2007-08-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added parameterized URI support.
	* src/main.cc: -Z option added.
	* src/OptionHandlerFactory.cc
	* src/prefs.h: Added PREF_FORCE_SEQUENTIAL.
	* src/PStringDatum.h: New class.
	* src/PStringSegment.{h,cc}: New class.
	* src/PStringNumLoop.h: New class.
	* src/PStringSelect.h: New class.
	* src/NumberDecorator.h: New class.
	* src/FixedWidthNumberDecorator.h: New class.
	* src/AlphaNumberDecorator.h: New class.
	* src/PStringVisitor.h: New class.
	* src/PStringBuildVisitor.{h,cc}: New class.
	* src/ParameterizedStringParser.{h,cc}: New class.
	* src/Util.{h,cc}
	(isNumber): New function.
	(isLowercase): New function.
	(isUppercase): New function.
	(alphaToNum): New function.
	* test/ParameterizedStringParserTest.cc: New class.
	* test/AlphaNumberDecoratorTest.cc: New class.
	* test/PStringBuildVisitorTest.cc: New class.
	* test/UtilTest.cc
	(testIsNumber): New function.
	(testIsLowercase): New function.
	(testIsUppercase): New function.
	(testAlphaToNum): New function.
	
	Added '\n' after the error message
	* src/RequestInfo.h (printDownloadAbortMessage)
2007-08-28 11:51:20 +00:00
Tatsuhiro Tsujikawa 3cc1ed5e09 2007-08-10 Ross Smith II <aria2spam at smithii dot com>
gcc 3.4.4 support:
	* src/DefaultBtContext.cc: int32_t -> int
	* src/main.cc: int -> int32_t, int32_t -> int
	* src/messageDigest.h: uint32_t -> unsigned int
	* src/NameResolver.h: int32_t -> int
	* src/PeerConnection.cc: int -> int32_t
	* src/SpeedCalc.cc: int32_t -> int
	* src/TrackerUpdateCommand.h: int -> int32_t
	* src/Util.cc: int32_t -> int
	* src/Util.h: int32_t -> int
	* src/Xml2MetalinkProcessor.cc: int -> uint32_t, int64_t -> 
uint64_t
	* test/AnnounceListTest.cc: int -> int32_t
	* test/ChunkedEncodingTest.cc: int -> int32_t
	* test/DataTest.cc: int -> int32_t
	* test/DefaultBtRequestFactoryTest.cc: int -> int32_t
	* test/DefaultPeerListProcessorTest.cc: int -> int32_t
	* test/DefaultPieceStorageTest.cc: int -> int32_t
	* test/FeatureConfigTest.cc: int -> int32_t
	* test/MetalinkEntryTest.cc: int -> int32_t
	* test/MockBtRequestFactory.h: int -> int32_t
	* test/MockPieceStorage.h: int -> int32_t
	* test/OptionTest.cc: int -> int32_t
	* test/RequestTest.cc: int -> int32_t
	* test/SegmentManTest.cc: int -> int32_t
	* test/Xml2MetalinkProcessorTest.cc: int -> int32_t
2007-08-15 15:11:01 +00:00
Tatsuhiro Tsujikawa 6aa98f9b9f 2007-08-10 Ross Smith II <aria2spam at smithii dot com>
Move sleep functions to Util class:
	* src/Util.cc
	(sleep): New function.
	(usleep): New function.
	* src/DownloadCommand.cc: sleep -> Util::sleep
	* test/TimeSeedCriteriaTest.cc: sleep -> Util::sleep

	MinGW build enhancements. The following files are added:
	* src/timegm.{c,h}

	Changes to support the above new files:
	* configure.ac
	* src/Makefile.am
	* src/a2time.h
	* src/Util.cc:
	* src/strptime.c: Added support for %Z option.

	Miscellenous build fixes/enhancements.
	* configure.ac: Added summary report.
	* src/Platform.h: Tweaked #include's.
	* src/a2netcompat.h: Tweaked #include's.
	* src/strptime.h: Tweaked #include's.
	* src/gai_strerror.c: Tweaked #include's.
	* src/gai_strerror.h: _D_GETADDRINFO_H -> _D_GAI_STRERROR_H
	* src/getaddrinfo.h: Moved #ifndef __MINGW32__
	* src/gettimeofday.h: Added HAVE_CONFIG_H
2007-08-14 14:51:08 +00:00
Tatsuhiro Tsujikawa 729d566678 Fixed typo: threw -> thrown 2007-08-09 14:54:36 +00:00