Commit Graph

504 Commits (386d19693bc3b06bea14f8fa606f513b6fe1ac9d)

Author SHA1 Message Date
Tatsuhiro Tsujikawa 3274b6acc7 2008-02-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed abort when peer's ip address is IPv4-mapped address.
	* src/DefaultBtContext.cc (computeFastSet)

	Removed number-and-dots criteria, since 
Util::isNumberAndDotsNotation()
	cannot handle IPv4-mapped addresses.
	* src/DefaultBtInteractive.cc (addPeerExchangeMessage)
2008-02-20 17:45:22 +00:00
Tatsuhiro Tsujikawa cfd0a40fdb 2008-02-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Proper return value handling for OpenSSL functions.
	* src/LibsslDHKeyExchange.h
2008-02-20 17:00:44 +00:00
Tatsuhiro Tsujikawa dd8f18956a 2008-02-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Random bytes generation using libgcrypt and OpenSSL.
	* src/DHTUtil.{h, cc}
	* test/DHTUtilTest.cc
2008-02-20 16:57:47 +00:00
Tatsuhiro Tsujikawa 1ea9033363 2008-02-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed segmentation fault when a DHT message which doesn't have 
'y' key
	received.
	* src/DHTMessageReceiver.cc (receiveMessage)
2008-02-20 16:52:09 +00:00
Tatsuhiro Tsujikawa c4aaea3ca2 2008-02-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that a return code is always 0. BUG#1897704
	If error occurred during the download or there exist unfinished
	downloads, aria2 returns with code 1.
	* src/RequestGroupMan.{h, cc}
	* src/MultiUrlRequestInfo.{h, cc}
	* src/main.cc
2008-02-20 16:46:56 +00:00
Tatsuhiro Tsujikawa 2cc471ebf6 2008-02-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
IPv6 support for SocketCore class.
	TODO: In SocketCore::establishConnection(), this is insufficient 
to
	determin the failure of connect() here because the socket is
	non-blocking state. The next addresses should be tried after 
select().
	TODO: NameResolver still uses c-ares(<= 1.4) 
ares_gethostbyname().
	If c-ares 1.5 or newer is installed, ares_getaddrinfo() should 
be used
	instead which address family independent.
	TODO: DHTRoutingTable{Deserializer,Serializer} currently saves 
peer
	information in a compact peer format which is for IPv4 only.
	
	Some BitTorrent functions in PeerMessageUtil still depends on 
IPv4 but
	this is a spec of BitTorrent protocol.
	* src/SocketCore.{h, cc}
	* src/PeerMessageUtil.cc
	* test/SocketCoreTest.cc
	* test/PeerMessageUtilTest.cc
	* test/DHTConnectionImplTest.cc

	Handle IPv4-mapped addresses.
	* src/DHTNode.cc: Now identity is determined by node id.
	* src/DHTMessageTrackerEntry.cc

	Because now PeerMessageUtil::unpackcompact() could fail, the 
caller
	should handle it.
	* src/DHTRoutingTableDeserializer.cc
	* src/DHTMessageFactoryImpl.cc
2008-02-20 13:02:48 +00:00
Tatsuhiro Tsujikawa 4708809094 2008-02-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Change the unit of --stop option from a minute to a second.
	* src/usage_text.h
	* src/DownloadEngineFactory.cc
	* src/OptionHandlerFactory.cc
	* src/message.h
	* src/TimedHaltCommand.cc
2008-02-20 12:33:16 +00:00
Tatsuhiro Tsujikawa 80bc9a8a21 2008-02-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Make listening socket non-block mode.
	* src/FtpConnection.cc
	* src/FtpNegotiationCommand.{h, cc}
	* src/PeerListenCommand.cc
	
	Fixed the bug that cause slow ftp negotiation.
	* src/FtpNegotiationCommand.{h, cc}
2008-02-19 13:36:39 +00:00
Tatsuhiro Tsujikawa 766e092af3 2008-02-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added basic tag to --enable-dht, --dht-listen-port option.
	* src/HelpItemFactory.cc (createHelpItems)
2008-02-19 12:05:21 +00:00
Tatsuhiro Tsujikawa c87b6b2984 2008-02-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Updated text.
	* src/usage_text.h
2008-02-18 17:37:54 +00:00
Tatsuhiro Tsujikawa 1d0175a29e 2008-02-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/MSEHandshake.cc (encryptAndSendData): Use std::min().
2008-02-18 17:13:20 +00:00
Tatsuhiro Tsujikawa 3c41ea24bf 2008-02-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Determin _threadtholdSpeed in each constructor for
	ActivePeerConnectionCommand and PeerReceiveHandshakeCommand.
	* src/ActivePeerConnectionCommand.{h, cc}
	* src/PeerReceiveHandshakeCommand.{h, cc}
	* src/BtSetup.cc
	* src/BtConstants.h
2008-02-18 17:11:44 +00:00
Tatsuhiro Tsujikawa 20cd2e5246 2008-02-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added --bt-min-crypto-level and --bt-require-crypto options.
	* src/OptionHandlerFactory.cc
	* src/MSEHandshake.cc
	* src/HelpItemFactory.cc
	* src/option_processing.cc
	* src/ReceiverMSEHandshakeCommand.cc
	* src/prefs.h
	* src/DefaultBtAnnounce.cc
	* src/InitiatorMSEHandshakeCommand.cc
	* src/usage_text.h
	* test/MSEHandshakeTest.cc
2008-02-18 13:41:58 +00:00
Tatsuhiro Tsujikawa c37539eb25 2008-02-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Bump version number to 0.13.0b
	* configure.ac
2008-02-17 16:17:26 +00:00
Tatsuhiro Tsujikawa b7e841e885 2008-02-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Updated doc.
	* src/MessageDigestHelper.h:
2008-02-17 16:12:47 +00:00
Tatsuhiro Tsujikawa ebd524b6a2 2008-02-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Use raw message digest as a token instead of its hexadecimal
	representation.
	* src/DHTTokenTracker.cc (generateToken)
2008-02-17 16:10:10 +00:00
Tatsuhiro Tsujikawa c0d2223c77 2008-02-16 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added Message Stream Encryption(MSE) support.
	Currently, aria2 accepts incoming connections with Obfuscation Header
	and legacy BitTorrent Header and establishes connections with
	Obfuscation Header first and if failed then retry with legacy
	BitTorrent header. If plain text and ARC4 is provided, aria2 always
	choose ARC4. The new option to change the default behavior is planned.
	For tracker extension, "supportcrypto=1" is added statically.
	* src/PeerInitiateConnectionCommand.{h, cc}
	* src/PeerConnection.{h, cc}
	* src/HandleRegistry.h
	* src/SocketCore.h
	* src/PeerReceiveHandshakeCommand.{h, cc}
	* src/BtRegistry.{h, cc}
	* src/PeerListenCommand.cc
	* src/InitiatorMSEHandshakeCommand.{h, cc}
	* src/ReceiverMSEHandshakeCommand.{h, cc}
	* src/MSEHandshake.{h, cc}
	* src/ARC4Encryptor.h
	* src/ARC4Decryptor.h
	* src/LibgcryptARC4Encryptor.h
	* src/LibgcryptARC4Decryptor.h
	* src/LibgcryptARC4Context.h
	* src/LibsslARC4Encryptor.h
	* src/LibsslARC4Decryptor.h
	* src/LibsslARC4Context.h
	* src/DHKeyExchange.h
	* src/LibgcryptDHKeyExchange.h
	* src/LibsslDHKeyExchange.h
	* src/DefaultBtAnnounce.cc: Just added "supportcrypto=1" parameter.
	* test/DefaultBtAnnounceTest.cc
	* test/ARC4Test.cc
	* test/DHKeyExchangeTest.cc
	
	Removed prepareForRetry() because it is not used.
	* src/PeerAbstractCommand.{h, cc}
	* src/PeerInteractionCommand.{h, cc}
	* src/PeerInitiateConnectionCommand.{h, cc}
2008-02-17 15:56:47 +00:00
Tatsuhiro Tsujikawa 1302123368 2008-02-13 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added the ability to load nodes from torrent file. These nodes are
	added to the routing table when downloading that torrent.
	* src/BtContext.h
	* src/DefaultBtContext.{h, cc}
	* src/DHTSetup.cc
	* src/DHTEntryPointNameResolveCommand.{h, cc}: Now accepts list of
	hostname and port pair, and resolves all of them.
	* src/NameResolver.{h, cc}: Added reset().
	* src/RequestGroup.cc	
	* test/DefaultBtContextTest.cc 
	* test/MockBtContext.h
	
	Removed assert() from DefaultBtContext and throw exception instead.
	* src/DefaultBtContext.cc
2008-02-13 15:17:08 +00:00
Tatsuhiro Tsujikawa bfcc300670 2008-02-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed segmentation fault bug when exiting if dht is disabled.
	* src/RequestGroup.cc
2008-02-12 13:49:39 +00:00
Tatsuhiro Tsujikawa bc1f1bdf35 2008-02-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed typo in log message and define the message in message.h
	* src/TimedHaltCommand.cc
	* src/message.h
2008-02-12 13:45:54 +00:00
Tatsuhiro Tsujikawa 1700f5c1bc 2008-02-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Included RecoverableException.h to fix compilation error.
	* test/DHTMessageFactoryImplTest.cc
2008-02-11 13:41:16 +00:00
Tatsuhiro Tsujikawa bebb7e1976 2008-02-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added test 'testDoReceivedAction' for DHTQueryMessage 
subclasses.
	* test/DHTPingMessageTest.cc
	* test/DHTGetPeersMessageTest.cc
	* test/DHTFindNodeMessageTest.cc
	* test/DHTAnnouncePeerMessageTest.cc
	* test/MockDHTMessage.h
	* test/MockDHTMessageFactory.h
	* test/MockDHTMessageDispatcher.h: New class.
2008-02-11 12:32:46 +00:00
Tatsuhiro Tsujikawa e9f980afc7 2008-02-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added DHTMessageDispatcherImpl. Now DHTMessageDispatcher is pure
	virtual.
	* src/DHTMessageDispatcher.h
	* src/DHTMessageDispatcherImpl.{h, cc}
	* src/DHTSetup.cc
2008-02-11 07:50:35 +00:00
Tatsuhiro Tsujikawa 413cbe192b 2008-02-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Adding handling of DHT error message. Just log error message and
	throw exception.
	* src/DHTMessageFactoryImpl.cc
	* test/DHTMessageFactoryImplTest.cc
2008-02-11 06:23:01 +00:00
Tatsuhiro Tsujikawa 34e6a1dc9a 2008-02-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added handling of dynamic cast failure.
	* src/DHTNodeLookupTask.cc
	* src/DHTPeerLookupTask.cc
2008-02-11 05:54:08 +00:00
Tatsuhiro Tsujikawa 9c277148b9 2008-02-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added the ability to stop aria2 itself when given time has 
passed
	from start. Use --stop option to specify time in minutes.
	When 0 is given, this feature is disabled.
	* src/OptionHandlerFactory.cc
	* src/TimeBasedCommand.h: Make _interval protected scope.
	* src/HelpItemFactory.cc
	* src/option_processing.cc
	* src/prefs.h
	* src/FillRequestGroupCommand.cc: Evaluate _e->isHaltRequested()
	before calling RequestGroupMan::fillRequestGroupFromReserver().
	Without this modification, the result list shows "ERR" when 
aria2 is
	stopped by --stop option. It should be "INPR".
	* src/DownloadEngine.{h, cc}
	* src/DownloadEngineFactory.cc
	* src/usage_text.h
	* src/TimedHaltCommand.{h, cc}: New class.
2008-02-11 05:07:08 +00:00
Tatsuhiro Tsujikawa 5d6f1c046a 2008-02-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Bootstrap through node added by port message.
	Currently bootstrap is executed if the number of buckets in routing
	table is 1.
	* src/BtPortMessage.{h, cc}
	* src/DefaultBtMessageFactory.{h, cc}
	* src/PeerInteractionCommand.cc
	* test/BtPortMessageTest.cc
	* test/MockDHTTask.h
2008-02-10 15:57:00 +00:00
Tatsuhiro Tsujikawa c064a2cd9e 2008-02-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Extract the Peer class's member variables, which are only needed 
after
	PeerInteractionCommand, into PeerSessionResource class.
	This class is instantiated in PeerInteractionCommand class's 
ctor and
	released in its dtor.
	This will make Peer class lightweight and uses less memory for 
peers
	which are not connected and wait in the queue.
	* src/PeerChokeCommand.cc
	* src/PeerSessionResource.{h, cc}
	* src/PeerInteractionCommand.cc
	* src/PeerAbstractCommand.cc: Note: 0 is given to onAbort() 
function.
	* src/DefaultBtInteractive.cc
	* src/BtPieceMessage.cc
	* src/BtInterestedMessage.cc
	* src/BtUnchokeMessage.cc
	* src/DefaultPeerStorage.{h, cc}
	* src/PeerInitiateConnectionCommand.cc
	* src/ActivePeerConnectionCommand.cc
	* src/BtNotInterestedMessage.cc
	* src/DefaultBtMessageDispatcher.cc
	* src/BtChokeMessage.cc
	* src/BtRequestMessage.cc
	* src/Peer.{h, cc}
	* src/BtRegistry.h
	* src/TrackerWatcherCommand.cc
	* src/PeerReceiveHandshakeCommand.cc
	* test/BtExtendedMessageTest.cc
	* test/BtAllowedFastMessageTest.cc
	* test/BtCancelMessageTest.cc
	* test/DefaultPieceStorageTest.cc
	* test/BtBitfieldMessageTest.cc
	* test/BtHaveMessageTest.cc
	* test/BtNotInterestedMessageTest.cc
	* test/BtRequestMessageTest.cc
	* test/PeerSessionResourceTest.cc
	* test/DefaultBtMessageDispatcherTest.cc
	* test/PeerTest.cc
	* test/BtInterestedMessageTest.cc
	* test/BtRejectMessageTest.cc
	* test/BtChokeMessageTest.cc
	* test/DefaultPeerStorageTest.cc
	* test/BtHaveNoneMessageTest.cc
	* test/BtHaveAllMessageTest.cc
	* test/DefaultExtensionMessageFactoryTest.cc
	* test/BtUnchokeMessageTest.cc
	* test/DefaultBtMessageFactoryTest.cc
	* test/HandshakeExtensionMessageTest.cc
	* test/UTPexExtensionMessageTest.cc
	* test/DefaultBtRequestFactoryTest.cc
	* test/BtPieceMessageTest.cc
	
	Removed typedef PeerStats.
	* src/PeerStat.h
	* src/SegmentMan.cc
2008-02-09 17:14:40 +00:00
Tatsuhiro Tsujikawa 04a7052013 2008-02-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added std namespace to copy, remove_copy, back_inserter,
	front_inserter.
	* src/RequestGroupMan.cc
	* src/DefaultPieceStorage.cc
	* src/StreamFileAllocationEntry.cc
	* src/BtFileAllocationEntry.cc
	* src/RequestGroup.cc
	* src/MetalinkEntry.cc
	* src/DelegatingPeerListProcessor.cc
	* src/DefaultBtRequestFactory.cc
	* src/DefaultBtMessageDispatcher.cc
	* src/version_usage.cc: Included <algorithm>
	* src/main.cc
	* src/MetalinkParserController.cc
	* src/DefaultBtContext.cc
	* src/DownloadEngineFactory.cc
	* src/a2algo.h

	Removed.
	* test/StreamUriListParserTest.cc
2008-02-08 18:39:26 +00:00
Tatsuhiro Tsujikawa f38eb15ca9 2008-02-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Only add socket to DownloadEngine's select routine when peer or
	localhost is unchoked and interested. This lowers CPU usage a
	little bit.
	* src/PeerInteractionCommand.cc
	* src/PeerAbstractCommand.{h, cc}
	* src/BtInteractive.h
	* src/DefaultBtInteractive.{h, cc}
2008-02-08 18:27:28 +00:00
Tatsuhiro Tsujikawa 9ab0ece87f 2008-02-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Revert previous change because get_peers message is needed for
	announce_peer anyway.	
	* src/DHTGetPeersCommand.cc
2008-02-08 18:21:19 +00:00
Tatsuhiro Tsujikawa f1d786469c 2008-02-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Request peers thought DHT only when download hasn't finished.
	* src/DHTGetPeersCommand.cc
2008-02-08 16:17:07 +00:00
Tatsuhiro Tsujikawa 6fe7b7c8f3 2008-02-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Force refresh bucket when startup if certain time has 
passed(currently 15 minutes).
	* src/DHTBucketRefreshTask.{h, cc}
	* src/DHTSetup.cc
2008-02-08 16:11:21 +00:00
Tatsuhiro Tsujikawa 1b7c198289 2008-02-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Removed "using namespace std;" from all sources. Appended std:: 
prefix to c++
	standard classes.
	Included string.h where mem* function are used.
2008-02-08 15:53:45 +00:00
Tatsuhiro Tsujikawa d82e183d34 2008-02-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Create directory before saving DHT routing table.
	Now ios::failure is now handled properly.
	* src/DHTAutoSaveCommand.cc
2008-02-05 17:38:24 +00:00
Tatsuhiro Tsujikawa 7b0a940ab4 2008-02-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Removed unnecessary cerr.
	* src/DownloadEngine.cc
2008-02-05 14:16:58 +00:00
Tatsuhiro Tsujikawa bdb1a25ca7 2008-02-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Catch exception inside DHTMessageReceiver::receiveMessage().
	Log unknown message.
	* src/DHTMessageReceiver.{h, cc}
	* src/DHTMessageFactory.h
	* src/DHTMessageFactoryImpl.{h, cc}
	* src/DHTMessageTracker.cc (handleTimeout): Catch and handle exception.
	* src/DHTInteractionCommand.cc
	* src/DHTUnknownMessage.{h, cc}
	* test/DHTUnknownMessageTest.cc
	* test/MockDHTMessageFactory.h
2008-02-05 14:15:50 +00:00
Tatsuhiro Tsujikawa 20621d011d 2008-02-02 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Commented out ip address comparison because a host can have 
multiple
	ip addresses and it is hard to predict the hostname is resolved 
into
	which one.
	* test/SocketCoreTest.cc (testWriteAndReadDatagram)
2008-02-02 13:06:55 +00:00
Tatsuhiro Tsujikawa af471b931e 2008-02-02 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* po/Makefile.in: Removed since this is generated by configure.
2008-02-02 11:28:07 +00:00
Tatsuhiro Tsujikawa 79764a1f11 2008-02-02 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed compiler warning about redefinition of SIZE_MAX.
	Use common.h instead of config.h directly here.
	* src/Platform.{h, cc}

	The check of ENABLE_NLS is made in gettext.h, so it is not 
required
	here.
	* common.h
	
2008-02-02  gettextize  <bug-gnu-gettext@gnu.org>

	Updated gettext related files.
	* configure.ac (AC_CONFIG_FILES): Add intl/Makefile.
	* configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.17.
2008-02-02 04:38:24 +00:00
Tatsuhiro Tsujikawa 0f13363229 2008-02-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added DHT functionality, compatible with mainline.
	DHT is disabled by default. To enable it, give --enable-dht to 
aria2c.
	You may need to specify entry point to DHT network using
	--dht-entry-point. DHT uses UDP port to listen incoming message.
	Use --dht-listen-port to specify port number. Make sure that 
your
	firewall configuration can pass through UDP traffic to the port.
	The routing table is saved in $HOME/.aria2/dht.dat.
	* src/DHT*
	* src/BNode.{h, cc}
	* src/PeerInteractionCommand.cc: enable DHT functionality for a
	particular torrent.
	* src/Data.cc: Rewritten ctor.
	* src/OptionHandlerFactory.cc: Added --enable-dht, 
--dht-listen-port,
	--dht-entry-point.
	* src/DefaultBtInteractive.cc: Send port message if dht is 
enabled.
	* src/RequestGroup.cc: Initialize DHT functionality. When 
download
	ends, remove BtContext from DHTPeerAnnounceStorage.
	* src/BtPortMessage.{h, cc}: Rewritten.
	* src/message.h
	* src/OptionHandlerImpl.cc
	* src/option_processing.cc: Added --enable-dht, 
--dht-listen-port,
	--dht-entry-point.
	* src/Dictionary.{h, cc} (remove): New function.
	* src/prefs.h
	* src/DefaultBtMessageFactory.h
	* src/BtHandshakeMessage.cc
	* src/ActivePeerConnectionCommand.cc
	* src/SocketCore.{h, cc}: Added datagram socket support.
	* src/DefaultBtMessageFactory.cc
	* src/BtSetup.cc: Add BtContext to DHTPeerAnnounceStorage here.
	Create DHT commands.
	* src/BtMessageFactory.h
	* src/PeerMessageUtil.{h, cc}
2008-02-01 17:36:33 +00:00
Tatsuhiro Tsujikawa 0bce06348e 2008-01-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that log file is not written when configuration 
file doesn't exist.
	This is caused by using Logger class before LogFactory is not 
configured.
	BUG #1875079
	* src/option_processing.cc

	Warning message "configuration doesn't exist" is only printed 
when --conf is
	given.
	* src/option_processing.cc
2008-01-20 15:20:16 +00:00
Tatsuhiro Tsujikawa a548f956fe 2008-01-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Use BencodeVisitor and MessageDigestHelper instead of 
ShaVisitor.
	ShaVisitor is now deprecated and slated to be removed.
	* src/DefaultBtContext.cc
2008-01-11 15:47:31 +00:00
Tatsuhiro Tsujikawa 160d5a8614 2008-01-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Externalize message to message.h
	* src/Platform.cc
	* src/message.h
2008-01-11 15:32:45 +00:00
Tatsuhiro Tsujikawa c1bc357d79 2008-01-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Set default domain and default path to cookie.
	* src/HttpResponse.cc
	* src/CookieBox.{h, cc}
	* src/CookieParser.{h, cc}
	* test/CookieParserTest.cc
2008-01-11 15:20:35 +00:00
Tatsuhiro Tsujikawa eafabe2d44 2008-01-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added --no-conf and --conf-path command-line option.
	--no-conf option disables loading aria2.conf file.
	--conf-path option changes the configuration file path. The 
default
	file path is $HOME/.aria2/aria2.conf
	Added a warning message when the configuration file is not 
found.
	* src/HelpItemFactory.cc
	* src/option_processing.cc
	* src/prefs.h
	* src/usage_text.h
2008-01-11 14:50:34 +00:00
Tatsuhiro Tsujikawa 08a8d8aae2 2008-01-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added the message to inform users that other help categories are
	available in -h option.
	* src/version_usage.cc
	* src/TagContainer.{h, cc}
	* test/TagContainerTest.cc
	* src/TaggedItem.{h, cc}
	* test/TaggedItemTest.cc
	* src/HelpItem.h
2008-01-11 14:10:42 +00:00
Tatsuhiro Tsujikawa 1a4100cbc9 2008-01-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added Piece::getFirstMissingBlockIndexWithoutLock() and it is 
called
	from PiecedSegment's ctor.
	Previously Piece::getAllMissingBlockIndexes() is called from
	PiecedSegment() but it is rather expensive since only first 
element is
	used.
	* src/PiecedSegment.cc
	* src/Piece.{h, cc}
2008-01-11 13:37:46 +00:00
Tatsuhiro Tsujikawa 83c82f3ec2 2008-01-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Rewritten get*Missing*Index functions. Now no need to allocate 
memory
	each time these functions are called.
	* src/BitfieldMan.{h, cc}
	* test/BitfieldManTest.cc
	* src/array_fun.h
	* test/array_funTest.cc 

	Now BitfieldMan::countBlock() returns BitfieldMan::blocks.
	Added new BitfieldMan::countFilteredBlock() to get the number of 
blocks
	filtered. Removed unnecessary cast to int32_t.
	* src/BitfieldMan.{h, cc}
2008-01-11 13:32:00 +00:00
Tatsuhiro Tsujikawa 5b8358b4d5 I forgot to commit PeerConnection.h
2008-01-10  Tatsuhiro Tsujikawa  <tujikawa at rednoah dot com>

	Fixed the bug that EX_TOO_LONG_PAYLOAD exception is thrown if just
	payload length(4bytes) are received. This happens because lenbufLength
	is not updated in this particular case and successive call of
	receiveMessage() overwrites payload length with bytes recieved which
	are payload body.
	* src/PeerConnection.{h, cc}
	* src/message.h
2008-01-10 15:22:55 +00:00
Tatsuhiro Tsujikawa 9a7fe58c57 2008-01-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that EX_TOO_LONG_PAYLOAD exception is thrown if just
	payload length(4bytes) are received. This happens because lenbufLength
	is not updated in this particular case and successive call of
	receiveMessage() overwrites payload length with bytes recieved which
	are payload body.
	* src/PeerConnection.cc
	* src/message.h
2008-01-10 15:12:32 +00:00
Tatsuhiro Tsujikawa f412691770 2008-01-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that DefaultPeerStorage::returnPeer() may delete wrong
	peer if there are peers that have same ipaddr and port.
	I've experiened segmentation fault and "pure virtual function was
	called" error.
	* src/Peer.h
	* test/PeerTest.cc
	* src/DefaultPeerStorage.cc
	* test/DefaultPeerStorageTest.cc
2008-01-10 14:59:11 +00:00
Tatsuhiro Tsujikawa b1b20abe02 2008-01-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Removed a call to isPowerOf() because it is no longer necessary 
here
	and a request block is not always power of 2.
	BUG#1866924
	* src/PeerMessageUtil.cc (checkLength)
2008-01-09 12:34:48 +00:00
Tatsuhiro Tsujikawa da84d3cf83 2008-01-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that always first found Segment is removed from
	usedSegmentEntries. Removed unused functions.
	* src/SegmentMan.{h, cc}
	* test/SegmentManTest.cc

	Fixed the bug that ServerHost is not removed.
	* src/RequestGroup.cc
2008-01-06 16:37:25 +00:00
Tatsuhiro Tsujikawa 574e1b3db8 2008-01-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that SegmentMan::completeSegment() is not called
	even if Segment is complete when --lowest-speed-limit is 
enabled.
	BUG#1864525
	* src/DownloadCommand.{h, cc}
2008-01-06 16:32:52 +00:00
Tatsuhiro Tsujikawa 6ab2962655 2008-01-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed: hash algorithm 'sha1' is always used. 
	* src/DownloadCommand.cc (validatePieceHash)
2008-01-06 12:01:17 +00:00
Tatsuhiro Tsujikawa eb718cfda0 2008-01-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added --enable-peer-exchange command-line option.
	* src/OptionHandlerFactory.cc
	* src/HelpItemFactory.cc
	* src/option_processing.cc
	* src/usage_text.h
2008-01-05 16:02:25 +00:00
Tatsuhiro Tsujikawa e5e75ee4ed 2008-01-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Move extension from BtRuntime to ExtensionMessageFactory, because
	extension can be specified per peer, not per torrent.
	* src/DefaultBtInteractive.cc
	* src/BtRuntime.h
	* src/ExtendedMessagingAware.h
	* src/ExtensionMessageFactory.h
	* src/DefaultExtensionMessageFactory.cc
	* test/DefaultExtensionMessageFactoryTest.cc
2008-01-05 15:51:21 +00:00
Tatsuhiro Tsujikawa fce7b4b32f 2008-01-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added categorized option help. Specify category using --help 
option.
	Also added the ability to search options in forward match.
	* src/HelpItem.{h, cc}
	* test/HelpItemTest.cc
	* src/HelpItemFactory.{h, cc}
	* src/TagContainer.{h, cc}
	* test/TagContainerTest.cc
	* src/option_processing.cc
	* src/prefs.h
	* src/TaggedItem.{h, cc}
	* test/TaggedItemTest.cc
	* src/version_usage.cc
	* src/help_tags.h
	* src/usage_text.h
2008-01-05 11:26:56 +00:00
Tatsuhiro Tsujikawa da4d9092b2 2008-01-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed segmentation fault when bad torrent metainfo is parsed.
	Added dynamic_cast properly to detect the misconfiguration of 
metainfo
	and then throw exception or skip it.
	* src/DefaultBtContext.{h, cc}
	* test/DefaultBtContextTest.cc
	* src/AnnounceList.cc
	* src/CompactPeerListProcessor.cc
	* src/message.h
	* src/DefaultBtAnnounce.{h, cc}
	* test/DefaultBtAnnounceTest.cc
	* src/BencodeVisitor.cc
2008-01-04 12:31:49 +00:00
Tatsuhiro Tsujikawa 853a8ef6aa 2007-12-29 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added missing "B"(=Byte). So now the message looks like this:
	Your share ratio was 1.0, uploaded/downloaded=12MiB/12MiB	
	* src/message.h (MSG_SHARE_RATIO_REPORT)
2007-12-29 07:17:51 +00:00
Tatsuhiro Tsujikawa 564e8e75fa 2007-12-29 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Show the seed ratio after torrent downloads.
	For example, after torrent download completed and --seed-time 
and
	--seed-ratio conditions are fulfilled, following message is 
printed
	right after "Download complete: .....":
	Your share ratio was 1.0, uploaded/downloaded=12M/12M
	* src/RequestGroupMan.cc
	* src/RequestGroup.{h, cc}
	* src/message.h
2007-12-29 07:02:35 +00:00
Tatsuhiro Tsujikawa 16722b559d 2007-12-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Remove a defunct control file. A defunct control file means that 
while
	it exists, but the corresponding download file is missing.
	After its removal, a download restarts from the beginning.
	* src/RequestGroup.cc
	* src/message.h
2007-12-26 15:11:42 +00:00
Tatsuhiro Tsujikawa e39f7a7e9c 2007-12-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Allocate bitfield in Peer when it is really used. More 
specifically,
	bitfield in Peer is allocated after the connection is 
established and
	deallocated when the connection is dropped.
	Since 2 parameters(piece length and total length) was removed 
from the
	constructor of Peer class, many test classes were modified 
accordingly.
	See svn log for more detailed information.
	* src/PeerInteractionCommand.cc
	* src/CompactPeerListProcessor.cc
	* src/Peer.cc
	* src/DefaultPeerListProcessor.cc
	* src/PeerListenCommand.cc
	* src/PeerReceiveHandshakeCommand.cc

	Fixed memory leak
	* src/Piece.cc
2007-12-26 14:26:55 +00:00
Tatsuhiro Tsujikawa eed41706fc 2007-12-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Changed the default value of PREF_PEER_CONNECTION_TIMEOUT and
	lowestSpeedLimit in ActivePeerConnectionCommand. TODO: Make them
	command-line options.
	* src/option_processing.cc
	* src/ActivePeerConnectionCommand.cc
2007-12-25 12:40:45 +00:00
Tatsuhiro Tsujikawa e707ba0a6c 2007-12-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Send have message to peer if it already has the piece.
	* src/BtHaveMessage.{h, cc}
2007-12-25 12:37:50 +00:00
Tatsuhiro Tsujikawa 20eb571ba1 Forgot to commit src/PeerReceiveHandshakeCommand.cc
2007-12-25  Tatsuhiro Tsujikawa  <tujikawa at rednoah dot com>

	Removed incomingPeer. Set 0 to peer's port if it is not a listening
	port.
	* src/DefaultPeerStorage.{h, cc}
	* test/DefaultPeerStorageTest.cc
	* src/HandshakeExtensionMessage.cc
	* test/HandshakeExtensionMessageTest.cc
	* src/Peer.{h, cc}: Added ipaddr and port to identity comparison.
	* src/PeerStorage.h
	* test/MockPeerStorage.h
	* src/PeerListenCommand.cc
	* src/PeerReceiveHandshakeCommand.cc
2007-12-25 12:35:54 +00:00
Tatsuhiro Tsujikawa f5b68379d5 2007-12-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Removed incomingPeer. Set 0 to peer's port if it is not a listening
	port.
	* src/DefaultPeerStorage.{h, cc}
	* test/DefaultPeerStorageTest.cc
	* src/HandshakeExtensionMessage.cc
	* test/HandshakeExtensionMessageTest.cc
	* src/Peer.{h, cc}: Added ipaddr and port to identity comparison.
	* src/PeerStorage.h
	* test/MockPeerStorage.h
	* src/PeerListenCommand.cc
2007-12-25 12:34:23 +00:00
Tatsuhiro Tsujikawa 7ff1f5a620 2007-12-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added --metalink-enable-unique-protocol option.
	* src/Metalink2RequestGroup.cc
	* src/option_processing.cc
	* src/prefs.h
	* src/version_usage.cc
	* doc/aria2c.1.txt
	* doc/aria2c.1
2007-12-22 06:40:58 +00:00
Tatsuhiro Tsujikawa 51cb6b5ba9 2007-12-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Allow a peer in incomingPeer to be added peers.
	* src/DefaultPeerStorage.cc
	* test/DefaultPeerStorageTest.cc
2007-12-22 06:08:58 +00:00
Tatsuhiro Tsujikawa ccd4a35096 2007-12-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that causes aria2 not to finish download. 
BUG#1855875.
	I could reproduce this bug in following procedure:
	1. Stop the download at the very beginning(1% or 100KB 
downloaded).
	2. Restart aria2.
	3. You see the download stopped around 99%.
	* src/HttpResponseCommand.cc (handleDefaultEncoding)
	* src/StreamFileAllocationEntry.cc: Removed the timeout 
handling.
	If timeout is reached, then _nextCommand is unused and it may 
contains
	segments and they won't be canceled. Actually, timeout is not 
needed
	here because if the server dropped connection, then retry is 
made.
2007-12-22 05:45:59 +00:00
Tatsuhiro Tsujikawa 286f34cb3f 2007-12-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added uTorrent compatible Peer Exchange.
	* src/BencodeVisitor.{h, cc}
	* test/BencodeVisitorTest.cc
	* src/BtConstants.h
	* src/BtContext.h: Added 'private' flag.
	* src/BtExtendedMessage.{h, cc}
	* test/BtExtendedMessageTest.cc
	* src/BtHandshakeMessage.{h, cc}: Set extended messaging bit in
	reserved field.
	* test/BtHandshakeMessageTest.cc
	* src/BtMessageFactory.h
	* src/BtRegistry.h
	* src/BtRuntime.h: This class holds default extension message 
IDs for
	aria2. By default, aria2 uses ID 8 for ut_pex.
	* src/DefaultBtContext.cc
	* src/DefaultBtInteractive.{h, cc}: This class holds 
_utPexEnabled.
	When it is true, aria2 enables ut_pex. This value is set by
	PeerInteractionCommand.
	* src/DefaultBtMessageFactory.{h, cc}
	* test/DefaultBtMessageFactoryTest.cc
	* src/DefaultBtMessageReceiver.cc: Moved the code of fast 
extension
	handling to DefaultBtInteractive class.
	* src/DefaultExtensionMessageFactory.{h, cc}
	* test/DefaultExtensionMessageFactoryTest.cc
	* src/DefaultPeerStorage.cc: Returns false if a peer is already 
in
	the container(peers and incomingPeers. The equality is 
determined by
	Peer::id).
	* test/DefaultPeerStorageTest.cc
	* src/ExtensionMessage.h
	* test/MockExtensionMessage.h
	* src/ExtensionMessageFactory.h
	* test/MockExtensionMessageFactory.h
	* src/HandshakeExtensionMessage.{h, cc}
	* test/HandshakeExtensionMessageTest.cc
	* src/MetaEntry.h
	* src/Peer.{h, cc}
	* src/PeerInteractionCommand.cc
	* src/PeerReceiveHandshakeCommand.cc: Evaluate the return value 
of
	addIncomingPeer.
	* src/PeerMessageUtil.{h, cc}
	* src/PeerObject.h
	* src/UTPexExtensionMessage.{h, cc}
	* test/UTPexExtensionMessageTest.cc
	* src/message.h
	* src/prefs.h

	Fixed the bug that returns incomplete data when it contains null
	character. A convenient constructor was also added.
	* src/Data.{h, cc}

	Rewritten.
	* src/CompactPeerListProcessor.cc

	Fixed typos.
	* src/message.h
	* src/MetaFileUtil.cc
2007-12-22 03:57:55 +00:00
Tatsuhiro Tsujikawa c25f4cffc0 2007-12-16 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added "Status Legend" label to the explanation text of 'stat' in
	download result and moved it to the last. BUG#1848214
	* src/RequestGroupMan.cc
2007-12-15 16:29:26 +00:00
Tatsuhiro Tsujikawa d1d653abf3 2007-12-16 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that -lexpat is always added to aria2c_LDADD.
	* src/Makefie.am
	* test/Makefile.am
2007-12-15 15:52:02 +00:00
Tatsuhiro Tsujikawa 1e63b1cda5 2007-12-15 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that prevents aria2 from loading cookie file when 
expire
	value is greater than 2^31-1. BUG#1851066
	* src/CookieBoxFactory.cc
	* test/CookieBoxFactoryTest.cc
2007-12-15 14:34:31 +00:00
Tatsuhiro Tsujikawa 3ea4fe447a 2007-12-14 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
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.
2007-12-14 00:46:32 +00:00
Tatsuhiro Tsujikawa e07ee38ed1 2007-12-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Disabled -s option in metalink download.
	* src/Metalink2RequestGroup.cc
2007-12-12 14:08:19 +00:00
Tatsuhiro Tsujikawa fca7b9d7e4 2007-12-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
If several protocols are available for a mirror, aria2 now use 
one of
	them. --metalink-preferred-protocol option was added to specify 
the
	preference of protocol.
	* src/AbstractCommand.cc
	* src/OptionHandlerFactory.cc
	* src/ServerHost.{h, cc}
	* src/Metalink2RequestGroup.cc
	* src/RequestGroup.{h, cc}
	* test/RequestGroupTest.cc
	* src/option_processing.cc
	* src/prefs.h
	* src/HttpResponseCommand.cc
	* src/MetalinkResource.{h, cc}
	* src/FtpNegotiationCommand.cc
	* src/MetalinkEntry.{h, cc}
	* src/MetalinkEntryTest.cc
2007-12-12 13:53:33 +00:00
Tatsuhiro Tsujikawa ae2555313b 2007-12-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Code cleanup and added debug log.
	* src/PeerConnection.cc
2007-12-12 13:49:09 +00:00
Tatsuhiro Tsujikawa 7d62e1877e 2007-12-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Compiler error fix: applied the patch by Tiziano Mueller
	* src/RequestGroup.cc
2007-12-10 14:01:21 +00:00
Tatsuhiro Tsujikawa b482568d59 2007-12-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug: only first announce URL is tried in AnnounceTier,
	in stopped and completed event.
	* src/AnnounceList.{h, cc}
	* test/AnnounceListTest.cc
	* src/DefaultBtAnnounce.cc
	* test/DefaultBtAnnounceTest.cc

	Sorted URLs.
	* test/Metalink2RequestGroupTest.cc
2007-12-09 15:54:54 +00:00
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 2fe11ac548 2007-12-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Removed unnecessary string copy. Updated doc and corrected indentation.
	* src/Base64.cc
	
	* Release 0.12.0
2007-12-08 16:55:44 +00:00
Tatsuhiro Tsujikawa 059406ae50 2007-12-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* Release 0.12.0
2007-12-08 15:14:26 +00:00
Tatsuhiro Tsujikawa ecb0846c34 2007-12-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Updated translations
	* po/{de,fr,ja,nl,ru}.po
	
	Added Brazilian Portuguese, Catalan, Italian, Spanish, Swedish
	translations. Many thanks to translators.
	* po/{ca,es,it,pt_BR,sv}.po
	* po/LINGUAS
2007-12-08 15:12:42 +00:00
Tatsuhiro Tsujikawa 5941a00f65 2007-12-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added a notice about URL
	* src/version_usage.cc
2007-12-08 10:48:51 +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 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
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 f3f8cc593c 2007-10-29 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Use RequestGroup::allDownloadFinished() to decide whether the 
control
	file should be removed or saved.
	* src/RequestGroup.{h, cc} (allDownloadFinished): New function.
	* src/RequestGroupMan.cc (removeStoppedGroup) (save)
2007-10-29 14:06:59 +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 eecd51bcb5 Updated ChangeLog 2007-10-27 13:26:33 +00:00
Tatsuhiro Tsujikawa fdb2ee28cc 2007-10-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/ConsoleStatCalc.cc: Let the user know that aria2 is now 
seeding
	after the download finishes.
2007-10-27 11:54:57 +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 343228629a 2007-10-16 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/ConsoleCalc.cc (calculateStat): Hide SPD after the 
download
	finished.
2007-10-16 11:46:39 +00:00
Tatsuhiro Tsujikawa e8a3167596 2007-10-15 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/Metalink2RequestGroup.cc (generate): Throw exception 
instead of
	catching it inside the method.
	When no file entry is found in a metalink without querying user
	preferences, throw the exception with the error message that 
suggests
	metalink file is probably broken. 
	* src/RequestGroup.cc (postDownloadProcessing): Catch exception 
here.
2007-10-15 14:55:24 +00:00
Tatsuhiro Tsujikawa 0ead885da5 2007-10-15 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that prevents remote Metalink/Torrent file from begin
	processed.
	* src/RequestGroupMan.cc (removeStoppedGroup)

	Added debug message.
	* src/BtPostDownloadHandler.cc
	* src/MetalinkPostDownloadHandler.cc
	* src/PostDownloadHandler.{h, cc}
	* src/RequestGroup.cc
2007-10-15 13:22:02 +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 e5454000a6 2007-10-14 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/MultiUrlRequestInfo.h: Updated the message shown when 
program
	stops and there are any unfinished or in-progress downloads.
	Added the legend of "stat".
2007-10-13 15:47:22 +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 295c36c767 2007-09-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Updated man page.
	* doc/aria2c.1.txt
	
	* Release 0.11.3
2007-09-09 16:17:35 +00:00
Tatsuhiro Tsujikawa 2ea9ef9f1e 2007-09-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Updated fr.po by sebone
	* po/fr.po
2007-09-09 04:49:14 +00:00
Tatsuhiro Tsujikawa d9fab1f061 2007-09-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/MetalinkRequestInfo.cc (execute): Fixed BitTorrent 
download
	failure in Metalink.
2007-09-05 12:40:08 +00:00
Tatsuhiro Tsujikawa 9c1bef16c2 2007-09-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Updated man page.
	* doc/aria2.1.txt
	
	* Release 0.11.3-rc
2007-09-03 14:17:10 +00:00
Tatsuhiro Tsujikawa 6ce850e580 2007-09-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Disable parameterized URI support by default. Added -P option to
	enable the feature.
	* src/prefs.h: Added PREF_PARAMETERIZED_URI
	* src/OptionHandlerFactory.cc
	* src/main.cc: Also updated usages for -Z and 
--auto-file-renaming

	Updated Japanese translation.
	* po/ja.po
2007-09-03 11:43:28 +00:00
Tatsuhiro Tsujikawa cf5cb05816 2007-09-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Automatically save *.aria2 control file of http/ftp download in 
every
	60 seconds.
	* src/AutoSaveCommand.{h, cc}: New class.
	* src/TimeBasedCommand.{h, cc}: New class.
	* src/DownloadEngineFactory.cc (newConsoleEngine)
2007-09-03 10:32:19 +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 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 eb335ef44c 2007-08-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Merged Ross's patch: Removed setmode(). Use _CRT_fmode to enable 
binary
	IO.
	* src/DefaultBtProgressInfoFile.cc
	* src/MetaFileUtil.cc
	* src/SimpleLogger.cc
	* src/SegmentMan.cc
	* src/Util.cc
	* src/Platform.cc
2007-08-26 03:10:09 +00:00
Tatsuhiro Tsujikawa 674a077bff 2007-08-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/Xml2MetalinkProcessor.cc (getPieceHash): Added missing 
.c_str().
2007-08-24 10:11:45 +00:00
Tatsuhiro Tsujikawa 834625364f Fixed MinGW non-blocking bug.
* src/SocketCore.cc
	* src/HttpRequestCommand.cc

	Added src/timegm,{h,c}
2007-08-18 10:26:20 +00:00
Tatsuhiro Tsujikawa 657a40935e 2007-08-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Avoid sparse files if possible, because VFAT32 doesn't support 
it.
	* src/DefaultDiskWriter.cc (initAndOpenFile)

	Fixed the bug that prevents file allocation is not done when
	dowloading multi-torrent file.
	* src/AbstractDiskWriter.cc (openFile)
	
	Increase the maximum number of -j option from 15 to 45.
	* src/OptionHandlerFactory.cc (createOptionHandlers)

	Added fr.po, thanks to Charles Landemaine.
	* po/fr.po
	* po/LINGUAS
2007-08-18 10:08:47 +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 1232c9fc7f Marked 0.11.2 release
Updated man page
2007-08-09 15:34:03 +00:00
Tatsuhiro Tsujikawa 645e66ea11 2007-08-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Increased the initial connection size in BitTorrent download to 
40.
	* src/BtRuntime.h

	Added the usage message of --peer-id-prefix option.
	* src/main.cc
2007-08-09 14:50:08 +00:00
Tatsuhiro Tsujikawa a405d0238e Fixed the bug that a remote metalink is not processed even if
'-o foo.metalink' is specified.
	* src/MetalinkRequestInfo.cc
2007-08-08 16:01:58 +00:00
Tatsuhiro Tsujikawa a3afa89941 Applied Ross's patch
* src/a2netcompat.h
	* src/main.cc

Updated man page
2007-08-08 15:26:19 +00:00
Tatsuhiro Tsujikawa e85f9ccfd6 2007-08-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
MessageDigestHelper is introduced in order to simplify the use
	of message digest. Removed repeated code.
	The message digest algorithm is now specified by string, like 
"sha1",
	"md5".
	* src/messageDigest.{h, cc}
	* src/MessageDigestHelper.{h, cc}: New class.
	* src/DefaultPieceStorage.cc
	* src/DefaultBtContext.{h, cc}
	(computeFastSet): New function.
	(setInfoHash): Added for unit testing.
	(setNumPieces): Added for unit testing.
	* src/DefaultBtInteractive.cc
	* src/BtPieceMessage.cc
	* src/Peer.cc
	* src/Checksum.h
	* src/message.h
	* src/IteratableChecksumValidator.h
	* src/ChunkChecksumValidator.{h, cc}: Use 
IteratableChecksumValidator
	inside it.
	* src/SegmentMan.{h, cc}
	(checkIntegrity): Removed.
	* src/IteratableChunkChecksumValidator.{h, cc}
	* src/Util.h
	(sha1Sum): Removed.
	(simpleMessageDigest): Removed.
	(fileChecksum): Removed.
	(computeFastSet): Removed.
	* src/ShaVisitor.cc
	* src/ChunkChecksum.h
	* src/DownloadCommand.cc

	Removed messageDigest virtual functions.
	* src/MultiDiskAdaptor.{h, cc}
	* src/DiskAdaptor.h
	* src/ByteArrayDiskWriter.h
	* src/DiskWriter.h
	* src/DiskAdaptorWriter.h
	* src/AbstractSingleDiskAdaptor.{h, cc}
	* src/AbstractDiskWriter.{h, cc}
	
	Fixed comilation error when message digest is disabled.
	* src/MetalinkEntry.{h, cc}
	* src/MetalinkRequestInfo.cc
	
	Removed srandom and random.
	* src/SimpleRandomizer.h

	Added size() virtual function to DiskAdaptor
	* src/MultiDiskAdaptor.h

	Fixed the bug that causes that files are not opened correctly in
	multi-file torrent.
	* src/TorrentRequestInfo.cc
	* src/MultiDiskAdaptor.cc
	
	Added SHA256 support
	* src/messageDigest.cc
	* src/Xml2MetalinkProcessor.cc

	Show supported message digest algorithms
	* src/main.cc

	Updated contact info.
	* src/main.cc
2007-08-08 14:40:11 +00:00
Tatsuhiro Tsujikawa b9859d2709 2007-08-02 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Updated contact info.
	* src/main.cc
2007-08-03 12:12:23 +00:00
Tatsuhiro Tsujikawa 54be1cbc4f 2007-08-02 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Merged Dan's patch:
	* src/ByteArrayDiskWriter.cc: ios_base -> ios

	Use va_copy to avoid core dump on amd64:
	* src/SimpleLogger.cc
2007-08-02 14:17:00 +00:00
Tatsuhiro Tsujikawa 46e8c332cd 2007-08-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Make a2netcompat.h include a2io.h to fix compilation error:
	* src/a2netcompat.h
	* src/SocketCore.cc: Removed include of a2io.h
	* src/Util.cc: Removed include of a2io.h
	
	Gather time related functions to a2time.h:
	* src/a2time.h: New file.
	* src/DefaultPeerStorage.cc
	* src/SimpleLogger.cc
	* src/Util.{h, cc}
	* src/SimpleRandomizer.h
	* src/TimeA2.{h,cc}
	* src/DownloadCommand.cc
	* src/main.cc

	Removed #ifdef __MINGW32__ since gai_strerror is included in
	a2netcompat.h:
	* src/NameResolver.cc
	
	Fixed compilation error without openssl:
	* src/SocketCore.{h,cc}: Moved include of openssl/err.h to 
SocketCore.h

	Added default block to suppress compiler warnings:
	* src/MetalinkRequestInfo.cc (AccumulateNonP2PUrl::operator())
	
2007-07-26  Ross Smith II  <aria2spam at smithii dot com>

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

	Changes to support the above new files:
	* configure.ac
	* src/Makefile.am
	* src/a2netcompat.h
	* src/TimeA2.cc
	* src/DefaultPeerStorage.cc
	* src/NameResolver.cc: removed mingw_strerror() function.
	* src/SocketCore.cc: removed mingw_strerror() function.

	Miscellaneous MinGW build fixes. 
	* src/a2io.h: Use _lseeki64() instead of lseek()
	* src/common.h
	* src/DefaultFileAllocator.cc
	* src/GlowFileAllocator.cc
	* src/main.cc: Moved #include "prefs.h" to quiet compile error.
	* src/NameResolver.cc
	(callback): Changed int32_t to int.
	(resolve): Changed int32_t to int.
	* src/Platform.cc
	* src/Platform.h
	* test/MultiDiskWriterTest.cc
	* test/PeerMessageUtilTest.cc
	* src/localtime_r.c: Add DeleteCriticalSection() and at exit().

	Other enhancements and fixes.
	* src/HttpRequestCommand.cc
	(executeInternal) Use non-blocking socket for HTTPS (MinGW 
only).
	* src/SocketCore.cc: 
	(error): New function to abstract errno/WSAGetLastError().
	(errorMsg): New function to abstract errno/WSAGetLastError().
	(initiateSecureConnection): Added more detailed error reporting.
	* src/SocketCore.h: Added private variable blocking, to allow
	proper handling of OpenSSL psuedo-errors.
	* src/message.h
	(EX_SSL_INIT_FAILURE)
	(EX_SSL_IO_ERROR)
	(EX_SSL_PROTOCOL_ERROR)
	(EX_SSL_UNKNOWN_ERROR)
	(EX_SSL_CONNECT_ERROR)
	(EX_SOCKET_BLOCKING)
	(EX_SOCKET_NONBLOCKING)
	(EX_SOCKET_UNKNOWN_ERROR)
	* src/Util.cc
	(setGlobalSignalHandler): Renamed signal to sig as signal is a
	reserved name.
	(httpGMT): Fixed typo.
2007-07-31 16:45:16 +00:00
Tatsuhiro Tsujikawa 380e3f0187 2007-07-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Merged Ross's win32 patch(manually)
	In the course of merging, following files are added.
	* src/strptime.{h,c}
	* src/libgen.{h,c}
	* src/inet_aton.{h,c}
	* src/Platform.{h,cc}
	* src/localtime_r.{h,c}
	* src/getaddrinfo.{h,c}
	I've gethered network related things, and put them to following 
file:
	* src/a2netcompat.h
	Also io related things are put to following file:
	* src/a2io.h
	
	Changed %lld to %s because mingw32 doesn't recognize %lld.
	* src/message.h
	(MSG_ALLOCATION_COMPLETED)
	(EX_TOO_LARGE_FILE)
	(EX_SIZE_MISMATCH)
	(EX_FILE_OFFSET_OUT_OF_RANGE)
	(EX_INVALID_CHUNK_CHECKSUM)
	(EX_INVALID_RANGE_HEADER)
	* src/FileAllocationCommand.cc
	* src/HttpResponse.cc
	* src/RequestGroup.cc
	* src/MultiDiskAdaptor.cc
	* src/OptionHandlerImpl.h
	* src/HttpResponseCommand.cc
	* src/FtpNegotiateCommand.cc
	* src/IteratableChecksumValidator.cc
	* src/SegmentMan.cc
	* src/ChunkChecksumValidator.cc
	
	Added Randomizer::getRandomNumber(long int)
	* src/Randomizer.h (getRandomNumber)
	* src/SimpleRandomizer.h (getRandomNumber)
	* src/BitfieldMan.cc (getMissingIndexRandomly): Use this new 
function.
	* src/Util.cc (randomAlpha): Use this new function.
2007-07-23 13:04:48 +00:00
Tatsuhiro Tsujikawa 6574e44f88 2007-07-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Converted int's to in32_t. long long int's are also converted to
	int64_t
2007-07-21 08:56:16 +00:00
Tatsuhiro Tsujikawa cd6b6e3591 2007-07-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that prevents cookies from being sent to the 
server
	if the domain of cookie is FQDN and starts with ".".
	* src/Cookie.cc (match)

	To add the ability to change peer id.
	* src/DefaultBtContext.h
	(_peerIdPrefix): New variable
	(setPeerIdPrefix): New function.
	* src/torrentRequestInfo.cc
	(execute): Set the option value of PREF_PEER_ID_PREFIX to
	DefaultBtContext.
	* src/main.cc (main): Added peer-id-prefix command-line option.
	The usage message is not added yet.
	* src/DefaultBtContext.cc
	(generatePeerId): Use _peerIdPrefix.
	* src/prefs.h (PREF_PEER_ID_PREFIX): New definition.
2007-07-20 17:06:21 +00:00
Tatsuhiro Tsujikawa 6e7893c848 2007-07-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that prevents cookies from being sent to the 
server
	if the domain of cookie is FQDN and starts with ".".
	* src/Cookie.cc (match)
2007-07-20 13:49:32 +00:00
Tatsuhiro Tsujikawa 247b1f2a4f 2007-07-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that prevents filename in content-disposition from
	being retrieved when filename is not quoted.
	* src/Util.cc (getContentDispositionFilename)

	Fixed the bug that causes infinate loop and memory leak when 
file open
	operation failed.
	* src/HttpResponseCommand.cc (handleDefaultEncoding)
2007-07-18 11:36:41 +00:00
Tatsuhiro Tsujikawa 77a3820920 2007-07-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that causes segfault when all URIs specified are
	unsupported.
	* src/RequestGroupMan.cc (getInitialCommands)
	Check if RequestGroup::createNextCommand() returns empty list of
	commands.
	* src/RequestGroup.cc (createNextCommand)
	Change log level from info to error so that users can notice 
that
	an error occurred.

	Fixed the bug that causes segfault when a zero-sized file is
	downloaded.
	* src/BitfieldMan.cc (isAllBitSet)
	Return true if bitfieldLength is 0.
2007-07-09 12:54:19 +00:00
Tatsuhiro Tsujikawa eab047dfba 2007-07-08 03:24:24 +00:00
Tatsuhiro Tsujikawa 444bf5495d 2007-07-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/main.cc
	(showUsage): Added 3 usage examples for metalink download.

	Replace MetalinkChunkChecksum with ChunkChecksum.
	* src/MetalinkChunkChecksum.h: Removed.
	* src/MetalinkEntry.h: MetalinkChunkChecksum -> ChunkChecksum.
	* src/Xml2MetalinkProcessor.h: MetalinkChunkChecksum -> 
ChunkChecksum.
	* src/Xml2MetalinkProcessor.cc
	(getPieceHash): Use ChunkChecksum instead of 
MetalinkChunkChecksum.
	* src/MetalinkRequestInfo.cc (execute)
2007-07-08 03:22:37 +00:00
Tatsuhiro Tsujikawa 823056f0dd * src/main.cc (main): Use StreamUriListParser and
FileUriListParser
	instead of UriFileListParser.
	(showUsage): Added 3 usage examples for metalink download.
2007-07-08 02:33:46 +00:00
Tatsuhiro Tsujikawa d80d7faac9 2007-07-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Reads URIs from stdin when "-i -" is specified.
	* src/UriFileListParser.h, src/UriFileListParser.cc: Removed.
	* src/UriListParser.h, src/UriListParser.cc: New class.
	* src/StreamUriListParser.h: New class.
	* src/FileUriListParser.h: New class.
	* src/main.cc (main): Use StreamUriListParser and 
FileUriListParser
	instead of UriFileListParser.
2007-07-05 15:45:03 +00:00
Tatsuhiro Tsujikawa e5e46914d1 2007-07-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Made console readout more readable.
	* src/ConsoleDownloadEngine.cc (sendStatistics)
2007-07-03 15:24:36 +00:00
Tatsuhiro Tsujikawa 583f6c9c22 2007-07-02 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fix the bug that causes -s option not to work.
	* src/main.cc (main)
	* src/a2algo.h: New file.
2007-07-02 12:40:40 +00:00
Tatsuhiro Tsujikawa a19cf91f9b 2007-07-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Create directory structure specified in metalink file.
	* src/RequestGroup.h, src/RequestGroup.cc
	(initAndOpenFile): Create a directory to store files if it does 
not
	exist.
	(getDir): New function.

	Added ETA and download speed for an individual file to readout.
	* src/ConsoleDownloadEngine.cc (sendStatistics)
	* src/RequestGroup.h
	(calculateDownloadSpeed): New function.
2007-07-01 14:19:15 +00:00
Tatsuhiro Tsujikawa 055c9e0b21 2007-07-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Create directory structure specified in metalink file.
	* src/RequestGroup.h, src/RequestGroup.cc
	(initAndOpenFile): Create a directory to store files if it does 
not
	exist.
	(getDir): New function.
2007-07-01 10:40:30 +00:00
Tatsuhiro Tsujikawa e36a3de0f4 2007-06-30 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Made -S option work with metalink file and provided selective 
download
	to metalink.
	* src/MetalinkEntry.h, src/MetalinkEntry.cc
	(filename): Removed.
	(file): New variable.
	(size): Removed.
	(operator=): Updated.
	(getPath): New function.
	(getLength): New function.
	(toFileEntry): New function.
	* src/TorrentRequestInfo.h, src/TorrentRequestInfo.cc
	(execute): Use toStream.
	(showFileEntry): Removed.
	* src/MetalinkRequestInfo.h
	(targetFiles): New variable.
	(setTargetFiles): New variable.
	* src/MetalinkRequestInfo.cc
	(execute): Added the ability to print file information included 
in
	a metalink file.
	Added selective download mode to metalink.
	* src/main.cc
	(showUsage): Updated to denote that -S and --select-file options 
are
	applicable to metalink.
	* src/FileEntry.h
	(operator=): New function.
	(getBasename): New function.
	(getDirname): New function.
	* src/Util.h, src/Util.cc
	(toStream): New function.
	* src/Xml2MetalinkProcessor.cc: Updated.
	
	Made aria2 work with metalink with directory structure.
	* src/File.h, src/File.cc
	(getBasename): New function.
	(getDirname): New function.
	* src/RequestGroup.h, src/RequestGroup.cc
	(_topDir): New variable.
	(setTopDir): New function.
	(initSegmentMan): A directory structure is added to 
_segmentMan->dir.
	
	Rewrote HTTP header parsing with stringstream.
	* src/HttpConnection.h, src/HttpConnection.cc
	(HttpRequestEntry): New class.
	(headerBuf): Removed.
	(headerBufLength): Removed.
	(outstandingHttpRequests): Now its element type is
	HttpRequestEntryHandle.
	(findEndOfHeader): Removed.
	(receiveResponse): Rewritten.
	
	Updated doc for -j option to notice that it should be used with 
-i
	option.
	* src/main.cc (showUsage)

	Removed unused classes.
	* src/RequestInfo.h
	(FileInfo): Removed.
	(checksum): Removed.
	(fileInfo): Removed.
	(setChecksum): Removed.
	(getChecksum): Removed.
	(getFileInfo): Removed.

	Use ISO units.
	* src/ConsoleDownloadEngine.cc
	* src/TorrentConsoleDownloadEngine.cc
	* src/Util.cc (abbrevSize)
2007-06-30 09:52:39 +00:00
Tatsuhiro Tsujikawa 50b4cf67e0 2007-06-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added the default listening ports to the help message.
	* src/main.cc (showUsage)
2007-06-23 06:25:12 +00:00
Tatsuhiro Tsujikawa d7155e8f6c 2007-06-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Reduce the number of calls to gettimeofday to lower CPU load.
	* src/TimeA2.h, src/TimeA2.cc (differenceInMillis): New 
function.
	* src/SpeedCalc.h, src/SpeedCalc.cc (calculateSpeed): New 
function.
	* src/Peer.h (calculateUploadSpeed): New function.
	(calculateDownloadSpeed): New function.
	* src/DefaultPeerStorage.cc
	(CalculateStat): Added _now variable.
	In operator(), call Peer::calculateDownloadSpeed(const struct 
timeval&)
	and Peer::calculateUploadSpeed(const struct timeval&)
	
	Drop connection if no request or piece message is exchanged in
	a certain interval.
	* src/DefaultBtInteractive.h
	(btRuntime): New variable.
	(inactiveCheckPoint): New variable.
	(checkActiveInteraction): New function.
	* src/DefaultBtInteractive.cc (receiveMessages): Reset timer 
when
	request or piece message is received.
	(checkActiveInteraction): New function.
	(doInteractionProcessing): Call checkActiveInteraction.

	Fixed the bug that causes remote Metalink and Torrent files are 
not
	processed.
	* src/MultiUrlRequestInfo.cc (createNextRequestInfo): Fixed the 
bug.
2007-06-20 14:43:34 +00:00
Tatsuhiro Tsujikawa ba6e5ac7e5 2007-06-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Changed format of log file.
	* src/SimpleLogger.cc
2007-06-12 10:50:40 +00:00
Tatsuhiro Tsujikawa 649830316e Fixed the bug that caused -c command-line option did not work properly. 2007-06-10 08:29:56 +00:00