Commit Graph

223 Commits (f84eac327f6ca4e1fb3641be2fb918094d3012d2)

Author SHA1 Message Date
Tatsuhiro Tsujikawa 4b67290f00 2008-02-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* test/AllTest.cc: Added OpenSSL, GNUTLS initialization code.
2008-02-21 02:21:14 +00:00
Tatsuhiro Tsujikawa 0d130b77f4 2008-02-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Make room for future enchancements for IPv6 addresses.
	Bump up version number of dht.dat file format to 2.
	Not compatible with previous version.
	* src/DHTRoutingTableSerializer.cc
	* src/DHTRoutingTableDeserializer.cc
	* test/DHTRoutingTableSerializerTest.cc
2008-02-21 02:19:55 +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 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 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 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 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 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 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 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 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 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 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 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 5516bc02cb Updated Makefile.am to include array_funTest.cc 2008-01-11 13:33:00 +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 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 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 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 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 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 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 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 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 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 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 7bf2c7751f Corrected comment 2007-12-08 10:49:20 +00:00
Tatsuhiro Tsujikawa bb4bff2c2a 2007-12-07 Tatsuhiro Tsujikawa <tujikawa at rednoah com>
Fixed the bug#1845750; CTRL+C does not stop torrent.
	aria2 repeatedly sends stopped request when tracker returns error code.
	* src/AnnounceList.cc
	* test/AnnounceListTest.cc
	* src/AnnounceTier.h

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	Removed duplicate code.
	* src/StreamCheckIntegrityEntry.cc

	Removed unnecessary include.
	* src/DiskWriter.h

	Included Exception.h
	* src/option_processing.cc

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

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

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

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

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

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

	Simplified prepareForNextSegment()
	* src/DownloadCommand.cc

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

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

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

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

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

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

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

	Miscellenous build fixes/enhancements.
	* configure.ac: Added summary report.
	* src/Platform.h: Tweaked #include's.
	* src/a2netcompat.h: Tweaked #include's.
	* src/strptime.h: Tweaked #include's.
	* src/gai_strerror.c: Tweaked #include's.
	* src/gai_strerror.h: _D_GETADDRINFO_H -> _D_GAI_STRERROR_H
	* src/getaddrinfo.h: Moved #ifndef __MINGW32__
	* src/gettimeofday.h: Added HAVE_CONFIG_H
2007-08-14 14:51:08 +00:00
Tatsuhiro Tsujikawa 729d566678 Fixed typo: threw -> thrown 2007-08-09 14:54:36 +00:00
Tatsuhiro Tsujikawa 958faeac06 Added unit test 2007-08-08 14:40:28 +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 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 a98caece59 Fixed unittest error 2007-07-23 14:53:39 +00:00
Tatsuhiro Tsujikawa 19ef788023 Merged Ross's patch to test code. 2007-07-23 14:09:46 +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 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 6303da136a Fixed examples for metalink 2007-07-09 13:30:45 +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 43af7c99f2 2007-07-05 15:46:36 +00:00
Tatsuhiro Tsujikawa 8559ef6b03 Added 2 test classes. 2007-07-05 15:45:37 +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 800bc3a6c3 Fixed compile error when message digest is not available. 2007-07-04 16:04:57 +00:00