Commit Graph

268 Commits (bb4bff2c2aee0f59e225f0879d30464bc20c46f1)

Author SHA1 Message Date
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 3bb307b518 2007-12-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Code cleanup
	* src/Base64.cc (encode)
2007-12-06 12:37:56 +00:00
Tatsuhiro Tsujikawa 68579bd2f4 2007-12-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Changed Direct/IO enable/disable procesure in file allocation routine.
	* src/SingleFileAllocationIterator.cc
	(SingleFileAllocationIterator):
	Disable directIO if offset is not multiple of 512.
	(~SingleFileAllocationIterator): Removed a call to disableDirectIO.
	* src/MultiFileAllocationIterator.cc (allocateChunk):
	Enable created SingleFileAllocationIterator's directIO.
	* src/FileAllocationEntry.cc
	(FileAllocationEntry): Enable directIO here.
	(~FileAllocationEntry): Disable directIO here.
2007-12-06 12:32:27 +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 2850c16f8a 2007-12-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Rewritten direct I/O support routine
	* src/SingleFileAllocationIterator.cc
	* src/MultiDiskAdaptor.{h, cc}
	* src/ByteArrayDiskWriter.h
	* src/AbstractSingleDiskAdaptor.h
	* src/AbstractDiskWriter.cc
	* src/DefaultPieceStorage.cc
	* src/DiskWriter.h
	* src/BinaryStream.h
	* src/IteratableChunkChecksumValidator.cc
	* src/IteratableChecksumValidator.cc
	* src/CheckIntegrityEntry.cc
	* src/FileAllocationEntry.cc
2007-12-05 17:11:22 +00:00
Tatsuhiro Tsujikawa 84e896eb09 2007-12-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed typo
	* src/version_usage.cc

	Updated doc
	* doc/aria2c.1.txt
	* doc/aria2c.1
2007-12-05 17:10:31 +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 ed3ebb7c22 2007-12-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Forced download abort when received negative response from 
http/ftp
	server.
	* src/HttpResponseCommand.cc
	* src/FtpNegotiationCommand.cc
	* src/HttpResponse.cc
	* src/FtpConnection.cc
2007-12-04 11:38:06 +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 d56dddd553 2007-12-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug#1841757: aria2 will connect to server to only get
	file size.
	* src/StreamFileAllocationEntry.cc
	* src/option_processing.cc
	* src/HttpResponseCommand.cc: Now reuse connection in segmented
	downloads.
	* src/FtpNegotiationCommand.cc
	
	Suppressed wrong message when finding PreDownloadHandler
	* src/RequestGroup.cc
2007-12-01 04:56:10 +00:00
Tatsuhiro Tsujikawa 23a41fba06 2007-11-29 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Updated usage
	* src/version_usage.cc

	Updated man page
	* doc/aria2c.1.txt
	* doc/aria2c.1

	Updated po files
	* po/aria2c.pot
	* po/*.po
	* po/*.gmo
2007-11-29 14:22:37 +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 6a0961f2bf 2007-11-29 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed a2io.h
	* src/a2io.h
2007-11-28 15:08:09 +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 a022a1826b 2007-11-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Updated usage
	* src/version_usage.cc
2007-11-27 15:16:12 +00:00
Tatsuhiro Tsujikawa 49989a16f7 2007-11-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Applied Ross's patch for MinGW port.
	* src/DownloadEngine.h
2007-11-27 13:23:09 +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 1dc88d47ab 2007-11-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Return false if RequestGroup::isPreLocalFileCheckEnabled() == 
true
	* src/RequestGroupMan.cc (isSameFileBeingDownloaded)

	Return false if RequestGroup::isPreLocalFileCheckEnabled() == 
true
	* src/RequestGroup.cc (downloadFinishedByFileLength)
2007-11-25 11:48:44 +00:00
Tatsuhiro Tsujikawa 9aee8878be 2007-11-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added the check to see whether ares_host_callback accepts 
timeouts
	with c-ares; only c-ares 1.5.0 or newer accepts it.
	* src/NameResolver.{h, cc}
	* m4/libcares.m4
	* configure.ac: Set C++ for language choice.
2007-11-25 04:41:31 +00:00
Tatsuhiro Tsujikawa 355a91cdec 2007-11-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed: compilation fails without c-ares/ares
	* src/DownloadEngine.cc (addCommand): Moved outside #ifdef

	Generate http/ftp commands only when download is incomplete.
	* src/BtFileAllocationEntry.cc (prepareForNextAction)
2007-11-24 11:32:22 +00:00
Tatsuhiro Tsujikawa 6d544c5827 Updated ChangeLog 2007-11-23 14:34:35 +00:00
Tatsuhiro Tsujikawa aff049ce8d 2007-11-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Throw DlAbortEx when a remote file is not found.
	* src/HttpResponse.cc
	* src/FtpNegotiationCommand.cc
	* src/message.h

	Overwrite an existing file if --allow-overwrite=true is given.
	* src/RequestGroup.cc

	Removed unused functions
	* src/AbstractCommand.h
2007-11-23 11:15:19 +00:00
Tatsuhiro Tsujikawa 49618788e3 2007-11-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Removed 'extern' from 'extern typedef ...' in src/*.h
2007-11-23 08:47:38 +00:00
Tatsuhiro Tsujikawa 5f5ef0004f 2007-11-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Updated usage
	* src/version_usage.cc
2007-11-23 08:23:38 +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 b27c529549 2007-11-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Set precision back to 1.
	* src/ConsoleStatCalc.cc (calculateStat)
2007-11-22 11:33:20 +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 1fed0c0cb0 2007-11-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Set precision to 2 because share ratio is rounded into 1.0 if 
precision
	set to 1.
	* src/ConsoleStatCalc.cc (calculateStat)
2007-11-21 16:23:17 +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 59fb4066fb 2007-11-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* 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
2007-11-18 11:59:42 +00:00
Tatsuhiro Tsujikawa cf8bd76213 2007-11-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Removed.
	* src/PiecedSegment.{h, cc} (operator==)(operator!=)

	Use Segment::operator==()
	* src/HttpConnection.cc
	* src/Segment.h

	Updated usage
	* src/version_usage.cc

	Added EINTR treatment.
	* src/SocketCore.cc
	* src/AbstractDiskWriter.cc

	Rewritten.
	* src/Util.cc (rangedFileCopy)
2007-11-17 17:39:05 +00:00
Tatsuhiro Tsujikawa ddefccd03c 2007-11-17 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed typo.
	* src/version_usage.cc
2007-11-17 14:05:50 +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 3adebc4d45 2007-11-13 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added the ability to detect duplicate download entry which is 
about to
	download the same file other RequestGroup is downloading.
	* src/RequestGroup.cc
	* src/HttpResponseCommand.cc
	* src/FtpNegotiationCommand.cc
2007-11-13 11:46:58 +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 76b9093d09 2007-11-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Changed CheckIntegrityEntry interface so that it can define
	the action when all the chunk checksums are valid.
	* src/CheckIntegrityEntry.h
	* src/StreamCheckIntegrityEntry.{h, cc}
	* src/BtCheckIntegrityEntry.{h, cc}: Currently,when all the 
checksums
	are valid, then aira2 goes to seeding mode. Sometimes it is 
better
	to exit rather than doing seeding. So, it would be good to 
toggle this
	behavior.
	* src/CheckIntegrityCommand.cc
	* src/AbstractCommand.cc
	* src/RequestGroup.cc
2007-11-08 10:59:44 +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 dfd40dff54 Updated ChangeLog 2007-11-06 15:21:11 +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 bcbadb3b6b 2007-11-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Now SleepCommand dispatches nextCommand when halt is requested.
	It avoids a possible long wait after hitting CTRL-C.
	* src/SleepCommand.{h, cc}
	* src/RequestGroupAware.{h, cc}
2007-11-05 11:42:43 +00:00