Commit Graph

885 Commits (7989cd898dc0bfef40ab1a7e2b747676620d6517)

Author SHA1 Message Date
Tatsuhiro Tsujikawa e7e214fef2 2010-03-30 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added --dht-message-timeout option.
	* doc/aria2c.1.txt
	* src/DHTConstants.h
	* src/DHTMessageDispatcherImpl.cc
	* src/DHTMessageDispatcherImpl.h
	* src/DHTMessageTracker.cc
	* src/DHTMessageTracker.h
	* src/DHTReplaceNodeTask.h
	* src/DHTSetup.cc
	* src/DHTTaskFactoryImpl.cc
	* src/DHTTaskFactoryImpl.h
	* src/OptionHandlerFactory.cc
	* src/prefs.cc
	* src/prefs.h
	* src/usage_text.h
	* test/DHTMessageTrackerTest.cc
2010-03-30 14:46:26 +00:00
Tatsuhiro Tsujikawa abe1e9843c 2010-03-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added --always-resume and --max-resume-failure-tries option.  If
	--always-resume=false is given, when all given URIs does not
	support resume or aria2 encounters N URIs which does not support
	resume
        (N is the value specified using --max-resume-failure-tries
	option), aria2 download file from scratch.  The default behavior
	is --always-resume=true, which means if all URIs do not support
	resume, download fails. I think this is OK because user normally
	don't like to see that partially downloaded file is
	overwritten(this is particularly true if file size is big).  This
	option is useful when aria2 is used as download backend and
	graceful falling back to overwritten behavior is preferable.
	Added exit status value 8, which means download failed because
	server did not support resume.
	* src/AbstractCommand.cc
	* src/DefaultPieceStorage.cc
	* src/DownloadCommand.cc
	* src/DownloadResultCode.h
	* src/FileEntry.h
	* src/FtpNegotiationCommand.cc
	* src/HttpResponse.cc
	* src/HttpResponseCommand.cc
	* src/OptionHandlerFactory.cc
	* src/RequestGroup.cc
	* src/RequestGroup.h
	* src/SegmentMan.cc
	* src/SegmentMan.h
	* src/prefs.cc
	* src/prefs.h
	* src/usage_text.h
	* test/DefaultPieceStorageTest.cc
	* test/SegmentManTest.cc
2010-03-28 07:23:33 +00:00
Tatsuhiro Tsujikawa 886f8ee58e 2010-03-25 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed arrayLength. Defined A2_ARRAY_LEN as macro to calculate
	size of array at compile time.
	* src/array_fun.h
	* test/BitfieldManTest.cc
	* test/BtPortMessageTest.cc
	* test/DHTRoutingTableDeserializerTest.cc
	* test/DHTRoutingTableSerializerTest.cc
	* test/DownloadHelperTest.cc
	* test/LongestSequencePieceSelectorTest.cc
	* test/MultiDiskAdaptorTest.cc
	* test/OptionParserTest.cc
	* test/PriorityPieceSelectorTest.cc
	* test/array_funTest.cc
2010-03-25 14:22:43 +00:00
Tatsuhiro Tsujikawa f15d22b619 2010-03-25 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added vbegin() and vend() for fixed sized array.
	* src/DownloadHandlerConstants.cc
	* src/FeatureConfig.cc
	* src/OptionHandlerFactory.cc
	* src/ServerStat.cc
	* src/TimeA2.cc
	* src/XmlRpcMethod.cc
	* src/array_fun.h
	* src/download_helper.cc
	* src/messageDigest.cc
	* src/util.cc
	* test/BittorrentHelperTest.cc
	* test/DHTRoutingTableDeserializerTest.cc
	* test/DHTRoutingTableSerializerTest.cc
	* test/DefaultBtAnnounceTest.cc
	* test/DefaultBtProgressInfoFileTest.cc
	* test/DownloadContextTest.cc
	* test/DownloadHelperTest.cc
	* test/FeatureConfigTest.cc
	* test/FeedbackURISelectorTest.cc
	* test/HttpRequestTest.cc
	* test/InOrderURISelectorTest.cc
	* test/MSEHandshakeTest.cc
	* test/MultiDiskAdaptorTest.cc
	* test/MultiFileAllocationIteratorTest.cc
	* test/PriorityPieceSelectorTest.cc
	* test/RequestGroupManTest.cc
	* test/UtilTest.cc
	* test/XmlRpcMethodTest.cc
	* test/a2algoTest.cc
	* test/array_funTest.cc
2010-03-25 13:51:10 +00:00
Tatsuhiro Tsujikawa a0d13a7fee 2010-03-21 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Defined gid_t as int64_t.
	* src/BtDependency.cc
	* src/BtStopDownloadCommand.cc
	* src/FtpNegotiationCommand.cc
	* src/HttpResponseCommand.cc
	* src/RequestGroup.cc
	* src/RequestGroup.h
	* src/RequestGroupMan.cc
	* src/TrackerWatcherCommand.cc
	* src/XmlRpcMethodImpl.cc
	* src/message.h
	* test/XmlRpcMethodTest.cc
2010-03-21 14:04:05 +00:00
Tatsuhiro Tsujikawa bf5f559c5c 2010-03-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use cuid_t type for cuid.
2010-03-20 14:30:36 +00:00
Tatsuhiro Tsujikawa 10edc156ea 2010-03-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added v key in DHT message. aria2's DHT version is independent of
	the package version and we defined it as 1 at the moment. It is
	defined as DHT_VERSION in src/DHTConstants.h. aria2's DHT version
	scheme is "A2"+2bytes DHT version number in network byte order.
	* src/DHTAbstractMessage.cc
	* src/DHTConstants.h
	* src/DHTMessage.cc
	* src/DHTMessage.h
	* src/DHTMessageFactoryImpl.cc
	* src/DHTQueryMessage.cc
	* src/DHTResponseMessage.cc
	* src/util.h
	* test/DHTAnnouncePeerMessageTest.cc
	* test/DHTAnnouncePeerReplyMessageTest.cc
	* test/DHTFindNodeMessageTest.cc
	* test/DHTFindNodeReplyMessageTest.cc
	* test/DHTGetPeersMessageTest.cc
	* test/DHTGetPeersReplyMessageTest.cc
	* test/DHTPingMessageTest.cc
	* test/DHTPingReplyMessageTest.cc
2010-03-20 09:10:23 +00:00
Tatsuhiro Tsujikawa e0335dcd4f 2010-03-19 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Lines starting "#" in -i list are treated as comments.
	Example:
	# this is comment
	http://example.org/file
	http://example.org/file2
	  dir=/tmp
	# another comment
	  out=myfile
	* doc/aria2c.1.txt
	* src/UriListParser.cc
	* test/filelist1.txt
2010-03-19 09:16:53 +00:00
Tatsuhiro Tsujikawa 4951142346 2010-03-19 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Accept IPv4 network address with CIDR block in --no-proxy option
	and no_proxy environment variable.  Current implementation does
	not resolve hostname in URI to compare network address. So it is
	only effecive if URI has numeric IP addresses.
	* doc/aria2c.1.txt
	* src/AbstractCommand.cc
	* src/OptionHandlerFactory.cc
	* src/bitfield.h
	* src/usage_text.h
	* src/util.cc
	* src/util.h
	* test/UtilTest.cc
	* test/bitfieldTest.cc
2010-03-19 08:56:17 +00:00
Tatsuhiro Tsujikawa 7bbc5769a5 2010-03-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Inspect all xt in magnet to find urn:btih.
	* src/bittorrent_helper.cc
	* test/BittorrentHelperTest.cc
2010-03-12 15:00:28 +00:00
Tatsuhiro Tsujikawa ca2b33c3da 2010-03-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Resurrected --http-proxy-user and --http-proxy-passwd option.
	Added --https-proxy-user, --https-proxy-passwd, --ftp-proxy-user,
	--ftp-proxy-passwd, --all-proxy-user, --all-proxy-passwd option.
	* doc/aria2c.1.txt
	* src/OptionHandlerFactory.cc
	* src/OptionHandlerImpl.h
	* src/prefs.cc
	* src/prefs.h
	* src/usage_text.h
	* test/OptionHandlerTest.cc
2010-03-11 15:09:34 +00:00
Tatsuhiro Tsujikawa 91b7b721ea 2010-03-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
For LPD sockets, bind IN_ADDRANY because binding multicast address
	fails under Windows.
	* src/LpdMessageReceiver.cc
	* test/LpdMessageDispatcherTest.cc
2010-03-09 14:19:25 +00:00
Tatsuhiro Tsujikawa d57ba674c4 2010-03-08 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed unit test error with mingw32 build.
	* test/LpdMessageReceiverTest.cc
2010-03-08 13:47:17 +00:00
Tatsuhiro Tsujikawa 4c1ca715f6 2010-03-08 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Updated automake-1.11.1
2010-03-08 12:39:16 +00:00
Tatsuhiro Tsujikawa ab6644c3de 2010-03-08 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed compile error and unit test error without openssl and
	gnutls.
	* src/MetalinkParserController.cc
	* test/MetalinkProcessorTest.cc
2010-03-08 12:17:26 +00:00
Tatsuhiro Tsujikawa c4a35932cb 2010-03-08 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed unitest fails if openssl doesn't support sha-256.
	* src/MetalinkParserStateV4Impl.cc
	* test/MetalinkProcessorTest.cc
2010-03-08 12:01:08 +00:00
Tatsuhiro Tsujikawa 6921e3c543 2010-03-08 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Wait until message arrives(again)
	* test/LpdMessageReceiverTest.cc
2010-03-08 11:59:12 +00:00
Tatsuhiro Tsujikawa 5f376f3c60 2010-03-08 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed compile error with --disable-bittorrent
	* test/Metalink2RequestGroupTest.cc
	* test/MetalinkParserControllerTest.cc
2010-03-07 15:37:18 +00:00
Tatsuhiro Tsujikawa 3ecf6e4b6f 2010-03-08 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Ignore filename parameter if it contains directory traversal
	directives.
	* src/util.cc
	* test/UtilTest.cc
2010-03-07 15:06:48 +00:00
Tatsuhiro Tsujikawa 41b7b9428f 2010-03-07 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
urldecode -> percentDecode
	* src/FtpConnection.cc
	* src/FtpNegotiationCommand.cc
	* src/HttpResponse.cc
	* src/Request.cc
	* src/magnet.cc
	* src/util.cc
	* src/util.h
	* test/UtilTest.cc
2010-03-07 14:29:40 +00:00
Tatsuhiro Tsujikawa 10b52bd9ac 2010-03-07 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
urlencode -> percentEncode,
	torrentUrlencode -> torrentPercentEncode
	* src/BtHandshakeMessage.cc
	* src/BtHandshakeMessageValidator.h
	* src/DHTMessageFactoryImpl.cc
	* src/DefaultBtAnnounce.cc
	* src/HandshakeExtensionMessage.cc
	* src/HttpRequest.cc
	* src/XmlRpcMethodImpl.cc
	* src/bittorrent_helper.cc
	* src/util.cc
	* src/util.h
	* test/DHTAnnouncePeerMessageTest.cc
	* test/DHTGetPeersMessageTest.cc
	* test/DHTGetPeersReplyMessageTest.cc
	* test/UTPexExtensionMessageTest.cc
	* test/UtilTest.cc
2010-03-07 14:24:21 +00:00
Tatsuhiro Tsujikawa 4785b7190c 2010-03-07 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that filename is percent encoded where it must be
	percent decoded in sendMdtm().
	* src/FtpConnection.cc
	* test/FtpConnectionTest.cc
2010-03-07 14:17:53 +00:00
Tatsuhiro Tsujikawa b0f180c99c 2010-03-07 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
url -> uri in Request class.
	* src/AbstractCommand.cc
	* src/AdaptiveURISelector.cc
	* src/DefaultBtAnnounce.cc
	* src/FeedbackURISelector.cc
	* src/FileEntry.cc
	* src/FileEntry.h
	* src/HttpRequest.h
	* src/HttpResponse.cc
	* src/InitiateConnectionCommandFactory.cc
	* src/Metalink2RequestGroup.cc
	* src/OptionHandlerImpl.h
	* src/ProtocolDetector.cc
	* src/Request.cc
	* src/Request.h
	* src/XmlRpcMethodImpl.cc
	* test/AuthConfigFactoryTest.cc
	* test/FtpConnectionTest.cc
	* test/HttpRequestTest.cc
	* test/HttpResponseTest.cc
	* test/RequestTest.cc
2010-03-07 10:36:42 +00:00
Tatsuhiro Tsujikawa 2cb0c8e69d 2010-03-07 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Made 'fileIndex' parameter in aria2.changeUri XML-RPC method
	1-based.
	* doc/aria2c.1.txt
	* src/XmlRpcMethodImpl.cc
	* test/XmlRpcMethodTest.cc
2010-03-07 07:24:19 +00:00
Tatsuhiro Tsujikawa b1713e6373 2010-03-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added changeUri XML-RPC method.  This method removes/adds URIs
	dynamically.
	* doc/aria2c.1.txt
	* src/AbstractCommand.cc
	* src/DownloadContext.cc
	* src/DownloadContext.h
	* src/FileEntry.cc
	* src/FileEntry.h
	* src/Request.cc
	* src/Request.h
	* src/RequestGroup.cc
	* src/RequestGroupMan.cc
	* src/XmlRpcMethodFactory.cc
	* src/XmlRpcMethodImpl.cc
	* src/XmlRpcMethodImpl.h
	* test/FileEntryTest.cc
	* test/XmlRpcMethodTest.cc
2010-03-06 14:21:43 +00:00
Tatsuhiro Tsujikawa 8d09b069e2 2010-03-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added Time global::wallclock to cache "current time" to reduce the
	call gettimeofday(). Global variables are now in namespace global.
	* src/AbstractCommand.cc
	* src/ActivePeerConnectionCommand.cc
	* src/AdaptiveURISelector.cc
	* src/BtLeecherStateChoke.cc
	* src/BtLeecherStateChoke.h
	* src/BtSeederStateChoke.cc
	* src/BtSeederStateChoke.h
	* src/BtStopDownloadCommand.cc
	* src/ConsoleStatCalc.cc
	* src/DHTBucket.cc
	* src/DHTGetPeersCommand.cc
	* src/DHTMessageTrackerEntry.cc
	* src/DHTNode.cc
	* src/DHTPeerAnnounceEntry.cc
	* src/DHTPeerAnnounceStorage.cc
	* src/DHTSetup.cc
	* src/DefaultBtAnnounce.cc
	* src/DefaultBtInteractive.cc
	* src/DefaultBtMessageDispatcher.cc
	* src/DefaultPeerStorage.cc
	* src/DefaultPieceStorage.cc
	* src/DownloadCommand.cc
	* src/DownloadEngine.cc
	* src/FileEntry.cc
	* src/HttpServerBodyCommand.cc
	* src/HttpServerCommand.cc
	* src/HttpServerResponseCommand.cc
	* src/LpdMessageDispatcher.cc
	* src/MultiUrlRequestInfo.cc
	* src/Peer.cc
	* src/Peer.h
	* src/PeerAbstractCommand.cc
	* src/PeerStat.h
	* src/RequestSlot.cc
	* src/RequestSlot.h
	* src/SegmentMan.cc
	* src/ServerStatMan.cc
	* src/SleepCommand.cc
	* src/SpeedCalc.cc
	* src/SpeedCalc.h
	* src/TimeA2.cc
	* src/TimeA2.h
	* src/TimeBasedCommand.cc
	* src/TimeSeedCriteria.h
	* src/UTMetadataRequestTracker.h
	* src/UTPexExtensionMessage.cc
	* src/wallclock.h
2010-03-06 08:29:53 +00:00
Tatsuhiro Tsujikawa 7637fd76a2 2010-03-05 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that util::itos(INT64_MIN) fails.
	* src/util.cc
	* src/util.h
	* test/UtilTest.cc
2010-03-05 14:38:49 +00:00
Tatsuhiro Tsujikawa db4ed87f7a 2010-03-05 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Don't use hash for Peer::id. Simple concatenation of ip address
	and port is enough.
	* src/Peer.cc
	* test/PeerTest.cc
2010-03-05 12:54:20 +00:00
Tatsuhiro Tsujikawa 8b73c2843f 2010-03-05 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Reduced copying/std::string instantiation in sending/receiving
	BitTorrent messages.
	* src/BtBitfieldMessage.cc
	* src/BtBitfieldMessage.h
	* src/BtExtendedMessage.cc
	* src/BtExtendedMessage.h
	* src/BtHandshakeMessage.cc
	* src/BtHandshakeMessage.h
	* src/BtKeepAliveMessage.cc
	* src/BtKeepAliveMessage.h
	* src/BtPieceMessage.cc
	* src/BtPieceMessage.h
	* src/BtPortMessage.cc
	* src/BtPortMessage.h
	* src/BtUnchokeMessage.h
	* src/DefaultBtMessageReceiver.cc
	* src/IndexBtMessage.cc
	* src/IndexBtMessage.h
	* src/PeerConnection.cc
	* src/PeerConnection.h
	* src/RangeBtMessage.cc
	* src/RangeBtMessage.h
	* src/SimpleBtMessage.cc
	* src/SimpleBtMessage.h
	* src/SocketBuffer.cc
	* src/SocketBuffer.h
	* src/ZeroBtMessage.cc
	* src/ZeroBtMessage.h
	* test/BtAllowedFastMessageTest.cc
	* test/BtBitfieldMessageTest.cc
	* test/BtCancelMessageTest.cc
	* test/BtChokeMessageTest.cc
	* test/BtExtendedMessageTest.cc
	* test/BtHandshakeMessageTest.cc
	* test/BtHaveAllMessageTest.cc
	* test/BtHaveMessageTest.cc
	* test/BtHaveNoneMessageTest.cc
	* test/BtInterestedMessageTest.cc
	* test/BtKeepAliveMessageTest.cc
	* test/BtNotInterestedMessageTest.cc
	* test/BtPieceMessageTest.cc
	* test/BtPortMessageTest.cc
	* test/BtRejectMessageTest.cc
	* test/BtRequestMessageTest.cc
	* test/BtSuggestPieceMessageTest.cc
	* test/BtUnchokeMessageTest.cc
2010-03-04 16:24:03 +00:00
Tatsuhiro Tsujikawa c929e95ff0 2010-03-03 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Wait until data arrives.
	* test/LpdMessageReceiverTest.cc
2010-03-02 15:34:10 +00:00
Tatsuhiro Tsujikawa 3bb7855a56 2010-03-03 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
In Metalink4, if size element contains invalid size, discard whole
	document. Added strict hash value check for metalink3/4.
	* src/MetalinkParserController.cc
	* src/MetalinkParserStateMachine.cc
	* src/MetalinkParserStateMachine.h
	* src/MetalinkParserStateV3Impl.cc
	* src/MetalinkParserStateV4Impl.cc
	* src/util.cc
	* src/util.h
	* test/MetalinkParserControllerTest.cc
	* test/MetalinkProcessorTest.cc
	* test/metalink4.xml
2010-03-02 15:14:39 +00:00
Tatsuhiro Tsujikawa ba78b6f167 2010-03-02 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added strict attribute validation for metalink4. When
	specification violation is found, discard the whole document.
	* src/ExpatMetalinkProcessor.cc
	* src/MetalinkParserStateMachine.cc
	* src/MetalinkParserStateMachine.h
	* src/MetalinkParserStateV4Impl.cc
	* src/XML2SAXMetalinkProcessor.cc
	* test/Makefile.am
	* test/MetalinkProcessorTest.cc
	* test/metalink4-attrs.xml: Removed
	* test/metalink4-dirtraversal.xml: Removed
2010-03-02 14:07:30 +00:00
Tatsuhiro Tsujikawa eb32f56479 2010-03-02 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added test for Metaurl transaction.
	* src/MetalinkParserController.cc
	* test/MetalinkParserControllerTest.cc
2010-03-01 17:20:41 +00:00
Tatsuhiro Tsujikawa c342bde962 2010-02-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use vector instead of deque for containers which is used for
	mostly read-only purpose.
2010-02-28 12:30:11 +00:00
Tatsuhiro Tsujikawa 135f0a2a8c 2010-02-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed typo
	* test/Makefile.am
2010-02-27 15:30:48 +00:00
Tatsuhiro Tsujikawa 24158f5d25 2010-02-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added metalink4-groupbymetaurl.xml to EXTRA_DIST
	* test/Makefile.am
2010-02-27 15:27:30 +00:00
Tatsuhiro Tsujikawa 88656eb14e 2010-02-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use vector instead of deque for MetalinkEntry and MetalinkResource
	objects.
	* src/Metalink2RequestGroup.cc
	* src/Metalink2RequestGroup.h
	* src/MetalinkEntry.cc
	* src/MetalinkEntry.h
	* src/MetalinkHelper.cc
	* src/MetalinkHelper.h
	* src/Metalinker.cc
	* src/Metalinker.h
	* src/main.cc
	* test/MetalinkEntryTest.cc
	* test/MetalinkHelperTest.cc
	* test/MetalinkProcessorTest.cc
	* test/MetalinkerTest.cc
2010-02-27 15:14:40 +00:00
Tatsuhiro Tsujikawa 0c62e90730 2010-02-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that grouped FileEntry objects are not used but
	instead all FileEntry objects are used for each metaurl group.
	* src/Metalink2RequestGroup.cc
	* test/Metalink2RequestGroupTest.cc
	* test/metalink4-groupbymetaurl.xml
2010-02-27 15:04:48 +00:00
Tatsuhiro Tsujikawa 18d7eb5b77 2010-02-27 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added MessageDigest::isStronger(). Now aria2 selects stronger hash
	algorithm in Metalink properly
	* src/MetalinkParserController.cc
	* src/MetalinkParserController.h
	* src/messageDigest.cc
	* src/messageDigest.h
	* test/MetalinkProcessorTest.cc
	* test/metalink4.xml
2010-02-27 14:24:15 +00:00
Tatsuhiro Tsujikawa e8d091af18 2010-02-27 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Replaced null or control characters in file path with '_'.  For
	MinGW32 build, additional characters which is not allowed in
	Windows kernel are also replaced. util::detectDirTraversal() now
	returns true if given string contains null or control characters.
	* src/DownloadContext.cc
	* src/DownloadContext.h
	* src/Metalink2RequestGroup.cc
	* src/MetalinkParserController.cc
	* src/bittorrent_helper.cc
	* src/util.cc
	* src/util.h
	* test/UtilTest.cc
2010-02-27 10:06:40 +00:00
Tatsuhiro Tsujikawa dc2a51b54a 2010-02-27 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Discard torrent file if path data in it contains directory
	traversal directives.  Discard metalink:file element in Metalink3
	format if its name attribute contains directory traversal
	directives.  Ignore name attribute of metalink:signature element
	in Metalink3 format if it contains directory traversal directives.
	* src/MetalinkParserStateV3Impl.cc
	* src/bittorrent_helper.cc
	* src/message.h
	* test/BittorrentHelperTest.cc
	* test/Makefile.am
	* test/MetalinkProcessorTest.cc
	* test/metalink3-dirtraversal.xml
	* test/test.xml
2010-02-27 08:22:58 +00:00
Tatsuhiro Tsujikawa 2a6775e80b 2010-02-27 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Supported name attribute of metalink::metaurl element and
	multi-file torrent with Metalink4.  Files with same metaurl are
	grouped and downloaded in one RequestGroup.
	* src/BtDependency.cc
	* src/FileEntry.h
	* src/Metalink2RequestGroup.cc
	* src/Metalink2RequestGroup.h
	* src/MetalinkEntry.cc
	* src/MetalinkEntry.h
	* src/MetalinkHelper.cc
	* src/MetalinkHelper.h
	* src/MetalinkMetaurl.cc
	* src/MetalinkMetaurl.h
	* src/MetalinkParserController.cc
	* src/RequestGroup.cc
	* src/RequestGroup.h
	* src/bittorrent_helper.cc
	* test/BittorrentHelperTest.cc
	* test/BtDependencyTest.cc
	* test/MetalinkHelperTest.cc
2010-02-26 15:37:08 +00:00
Tatsuhiro Tsujikawa 5032394c6a 2010-02-26 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Store name attribute of metalink:metaurl element in MetalinkMetaurl.
	* src/MetalinkMetaurl.h
	* src/MetalinkParserController.cc
	* src/MetalinkParserController.h
	* src/MetalinkParserStateMachine.cc
	* src/MetalinkParserStateMachine.h
	* src/MetalinkParserStateV4Impl.cc
	* test/MetalinkProcessorTest.cc
	* test/metalink4-dirtraversal.xml
2010-02-26 08:55:10 +00:00
Tatsuhiro Tsujikawa 15c1f64023 2010-02-26 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added MetalinkMetaurl class. It corresponds to metalink:metaurl
	element.
	* src/Makefile.am
	* src/Metalink2RequestGroup.cc
	* src/MetalinkEntry.cc
	* src/MetalinkEntry.h
	* src/MetalinkMetaurl.cc
	* src/MetalinkMetaurl.h
	* src/MetalinkParserController.cc
	* src/MetalinkParserController.h
	* src/MetalinkParserStateMachine.cc
	* src/MetalinkParserStateMachine.h
	* src/MetalinkParserStateV4Impl.cc
	* src/MetalinkParserStateV4Impl.h
	* test/MetalinkProcessorTest.cc
2010-02-25 16:00:24 +00:00
Tatsuhiro Tsujikawa 3880a5f71b 2010-02-25 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added Metalink4 support. Currently, name attribute of
	metalink::metaurl is ignored and multi-file torrent cannot be used
	with Metalink4.
	* doc/aria2c.1.txt
	* src/DownloadHandlerConstants.cc
	* src/ExpatMetalinkProcessor.cc
	* src/Makefile.am
	* src/Metalink2RequestGroup.cc
	* src/MetalinkEntry.cc
	* src/MetalinkEntry.h
	* src/MetalinkParserController.cc
	* src/MetalinkParserController.h
	* src/MetalinkParserState.h
	* src/MetalinkParserStateImpl.cc
	* src/MetalinkParserStateImpl.h
	* src/MetalinkParserStateMachine.cc
	* src/MetalinkParserStateMachine.h
	* src/MetalinkParserStateV3Impl.cc
	* src/MetalinkParserStateV3Impl.h
	* src/MetalinkParserStateV4Impl.cc
	* src/MetalinkParserStateV4Impl.h
	* src/MetalinkResource.cc
	* src/MetalinkResource.h
	* src/Metalinker.cc
	* src/RequestGroup.cc
	* src/RequestGroup.h
	* src/XML2SAXMetalinkProcessor.cc
	* src/messageDigest.cc
	* src/util.cc
	* src/util.h
	* test/Makefile.am
	* test/MetalinkEntryTest.cc
	* test/MetalinkParserControllerTest.cc
	* test/MetalinkProcessorTest.cc
	* test/MetalinkerTest.cc
	* test/UtilTest.cc
	* test/metalink4-attrs.xml
	* test/metalink4-dirtraversal.xml
	* test/metalink4.xml
2010-02-25 14:40:18 +00:00
Tatsuhiro Tsujikawa 232deb47b5 2010-02-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Return SharedHandle<LpdMessage>(new LpdMessage()) if received data
	is bad in LpdMessageReceiver.
	* src/LpdMessage.h
	* src/LpdMessageReceiver.cc
	* src/LpdMessageReceiver.h
	* src/LpdReceiveMessageCommand.cc
	* test/LpdMessageReceiverTest.cc
2010-02-22 16:11:33 +00:00
Tatsuhiro Tsujikawa 6ae5882f3c 2010-02-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added --bt-lpd-interface option to specify the interface to use
	for Local Peer Discovery. LpdMessageDispatcher object now has its
	own socket. LpdMessageReceiver's socket is binded to multicast
	address to only receive multicast packets.
	* src/BtSetup.cc
	* src/LpdMessageDispatcher.cc
	* src/LpdMessageDispatcher.h
	* src/LpdMessageReceiver.cc
	* src/LpdMessageReceiver.h
	* src/LpdReceiveMessageCommand.cc
	* src/LpdReceiveMessageCommand.h
	* src/OptionHandlerFactory.cc
	* src/SocketCore.cc
	* src/SocketCore.h
	* src/prefs.cc
	* src/prefs.h
	* src/usage_text.h
	* test/LpdMessageDispatcherTest.cc
	* test/LpdMessageReceiverTest.cc
2010-02-22 15:58:05 +00:00
Tatsuhiro Tsujikawa 9281f11264 2010-02-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added Local Peer Discovery. It is disabled by default. Use
	--bt-enable-lpd to enable the function.
	* src/BtConstants.h
	* src/BtSetup.cc
	* src/LpdDispatchMessageCommand.cc
	* src/LpdDispatchMessageCommand.h
	* src/LpdMessage.h
	* src/LpdMessageDispatcher.cc
	* src/LpdMessageDispatcher.h
	* src/LpdMessageReceiver.cc
	* src/LpdMessageReceiver.h
	* src/LpdReceiveMessageCommand.cc
	* src/LpdReceiveMessageCommand.h
	* src/Makefile.am
	* src/OptionHandlerFactory.cc
	* src/Peer.cc
	* src/Peer.h
	* src/PeerInteractionCommand.cc
	* src/SocketCore.cc
	* src/SocketCore.h
	* src/prefs.cc
	* src/prefs.h
	* src/usage_text.h
	* src/util.cc
	* src/util.h
	* test/LpdMessageDispatcherTest.cc
	* test/LpdMessageReceiverTest.cc
	* test/Makefile.am
2010-02-20 14:23:25 +00:00
Tatsuhiro Tsujikawa aee471e52c 2010-02-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
User-defined custom request headers specified by --header option
	now override builtin headers if they have same name.
	* src/HttpRequest.cc
	* src/HttpRequest.h
	* test/HttpRequestTest.cc
2010-02-20 12:55:23 +00:00
Tatsuhiro Tsujikawa 780aaf9c80 2010-02-19 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added unit tests for util::getContentDispositionFilename() from
	http://greenbytes.de/tech/tc2231/ Fixed the function so that added
	tests are passed.
	* src/util.cc
	* test/UtilTest.cc
2010-02-19 10:54:40 +00:00
Tatsuhiro Tsujikawa 2da32876a2 2010-02-18 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Support RFC2231 "Parameter Value Character Set and Language
	Information" in Content-Disposition header.
	* src/HttpResponse.cc
	* src/util.cc
	* src/util.h
	* test/UtilTest.cc
2010-02-17 16:09:19 +00:00
Tatsuhiro Tsujikawa ca3c52a787 2010-02-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed test file
	* test/CookieStorageTest.cc
2010-02-15 14:01:11 +00:00
Tatsuhiro Tsujikawa 91127ed864 2010-02-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed BitfieldManFactory class.
	* src/BitfieldManFactory.cc
	* src/BitfieldManFactory.h
	* src/DefaultPieceStorage.cc
	* src/Makefile.am
	* src/PeerSessionResource.cc
	* src/Piece.cc
	* src/main.cc
	* test/DefaultPieceStorageTest.cc
2010-02-11 08:28:41 +00:00
Tatsuhiro Tsujikawa b89e306599 2010-02-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed unused methods from BitfieldMan class.  Moved
	getFirstMissingIndex to bitfield.h. Updated doc for BitfieldMan
	class.
	* src/BitfieldMan.cc
	* src/BitfieldMan.h
	* src/BitfieldManFactory.cc
	* src/BitfieldManFactory.h
	* src/bitfield.h
	* src/main.cc
	* test/BitfieldManTest.cc
	* test/DefaultPieceStorageTest.cc
2010-02-11 08:22:37 +00:00
Tatsuhiro Tsujikawa e3e3f0438d 2010-02-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Moved getFirstNMissingIndex to bitfield.h and made it return the
	number of appended indexes.
	* src/BitfieldMan.cc
	* src/BitfieldMan.h
	* src/Piece.cc
	* src/Piece.h
	* src/bitfield.h
	* test/BitfieldManTest.cc
2010-02-11 07:24:06 +00:00
Tatsuhiro Tsujikawa aa1139bb67 2010-02-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added more tests.
	* test/BitfieldManTest.cc
2010-02-10 15:09:59 +00:00
Tatsuhiro Tsujikawa ccc552cec9 2010-02-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added BitfieldMan::getFirstNMissingUnusedIndex() to get multiple
	unused block indexes at once instead of calling
	getFirstMissingUnusedIndex() multiple times. Made use of it in
	Piece class and DefaultBtRequestFactory class via Piece class.
	* src/BitfieldMan.cc
	* src/BitfieldMan.h
	* src/DefaultBtRequestFactory.cc
	* src/Piece.cc
	* src/Piece.h
	* test/BitfieldManTest.cc
2010-02-10 15:07:06 +00:00
Tatsuhiro Tsujikawa da682bd6bd 2010-02-08 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed unused PeerSessionResource::_latency.
	* src/BtConstants.h
	* src/BtPieceMessage.cc
	* src/Peer.cc
	* src/Peer.h
	* src/PeerSessionResource.cc
	* src/PeerSessionResource.h
	* test/PeerSessionResourceTest.cc
2010-02-08 12:31:13 +00:00
Tatsuhiro Tsujikawa 01fc3204f2 2010-02-03 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Remove fragment from redirected URI.
	* src/Request.cc
	* test/RequestTest.cc
2010-02-03 13:49:22 +00:00
Tatsuhiro Tsujikawa 149530de4e 2010-01-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed cookietest.txt from Makefile.am
	* test/Makefile.am
2010-01-31 09:25:54 +00:00
Tatsuhiro Tsujikawa a4870cacb4 2010-01-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added bittorrent key to the response of tellStatus XML-RPC method.
	The associated value of the key is a struct and contains data
	retrieved from .torrent file, such as name, announce-list,
	comment, etc.
	* doc/aria2c.1.txt
	* src/XmlRpcMethodImpl.cc
	* src/XmlRpcMethodImpl.h
	* test/XmlRpcMethodTest.cc
2010-01-31 08:05:21 +00:00
Tatsuhiro Tsujikawa 100ad4e18a 2010-01-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed parse(std::istream&) and parse(const std::string&) from
	CookieParser.
	* src/CookieParser.cc
	* src/CookieParser.h
	* test/CookieParserTest.cc
	* test/cookietest.txt: Removed
2010-01-29 12:12:21 +00:00
Tatsuhiro Tsujikawa 58f51205c6 2010-01-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that cookie for domain a.b.c is not sent to the host
	a.b.c if no other cookies are stored.  Fixed the bug that
	Cookie::markOriginServerOnly() is not called when cookies are
	loaded from file/sqlite3 database.
	* src/Cookie.h
	* src/CookieStorage.cc
	* src/NsCookieParser.cc
	* src/Sqlite3MozCookieParser.cc
	* test/CookieStorageTest.cc
	* test/NsCookieParserTest.cc
	* test/Sqlite3MozCookieParserTest.cc
	* test/cookies.sqlite
	* test/nscookietest.txt
2010-01-29 12:04:36 +00:00
Tatsuhiro Tsujikawa 6645df820e 2010-01-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed RequestGroup::initSegmentMan(). Guaranteed that either
	both _pieceStorage and _segmentMan are initialized or they are
	not.
	* src/RequestGroup.cc
	* src/RequestGroup.h
	* test/BtDependencyTest.cc
2010-01-29 11:03:14 +00:00
Tatsuhiro Tsujikawa eb4116ae57 2010-01-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Replaced isNumberAndDotsNotation() with isNumericHost().
	isNumericHost() can handle IPv6 address.
	* src/Cookie.cc
	* src/CookieStorage.cc
	* src/util.cc
	* src/util.h
	* test/CookieTest.cc
	* test/UtilTest.cc
2010-01-28 14:25:16 +00:00
Tatsuhiro Tsujikawa 4043b6ccae 2010-01-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Rewritten Cookie storage.
	* src/Cookie.cc
	* src/Cookie.h
	* src/CookieParser.cc
	* src/CookieStorage.cc
	* src/CookieStorage.h
	* src/a2functional.h
	* test/CookieParserTest.cc
	* test/CookieStorageTest.cc
	* test/CookieTest.cc
	* test/HttpResponseTest.cc
	* test/TestUtil.h
	* test/a2functionalTest.cc
2010-01-28 14:01:50 +00:00
Tatsuhiro Tsujikawa 60c16887e6 2010-01-26 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Handle redirected URI which is not properly percent encoded.
	* src/Request.cc
	* test/RequestTest.cc
2010-01-26 12:39:22 +00:00
Tatsuhiro Tsujikawa b39ede01a7 2010-01-24 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed compile error with i586-mingw32msvc-g++.  Always Cut console
	readout by 80 characters in mingw32 build.  Catch exception in
	DHTMessageReceiver::receiveMessage().
	* src/AbstractDiskWriter.cc
	* src/ConsoleStatCalc.cc
	* src/DHTMessageReceiver.cc
	* src/File.cc
	* src/RequestGroupMan.cc
	* src/a2io.h
	* test/FileTest.cc
2010-01-24 13:49:07 +00:00
Tatsuhiro Tsujikawa 89982bb10f 2010-01-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed broken OptionParser::findByName().
	* src/OptionParser.cc
	* test/OptionParserTest.cc
2010-01-23 12:10:43 +00:00
Tatsuhiro Tsujikawa 03424dd1ce 2010-01-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed test error without BitTorrent support.
	* test/XmlRpcMethodTest.cc
2010-01-23 10:11:26 +00:00
Tatsuhiro Tsujikawa 06a52cad02 2010-01-22 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
aria2 now returns gzip compressed XML-RPC response if XML-RPC
	client accepts gzip content encoding.
	* src/A2STR.cc
	* src/A2STR.h
	* src/GZipEncoder.cc
	* src/GZipEncoder.h
	* src/HttpHeader.cc
	* src/HttpHeader.h
	* src/HttpServer.cc
	* src/HttpServer.h
	* src/HttpServerBodyCommand.cc
	* src/HttpServerCommand.cc
	* src/Makefile.am
	* src/XmlRpcResponse.cc
	* src/XmlRpcResponse.h
	* test/GZipEncoderTest.cc
	* test/Makefile.am
2010-01-22 14:09:39 +00:00
Tatsuhiro Tsujikawa b5ee1b5071 2010-01-17 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Rewritten toTagString
	* src/NameMatchOptionHandler.cc
	* test/OptionHandlerTest.cc
2010-01-17 13:58:42 +00:00
Tatsuhiro Tsujikawa 2d74b16583 2010-01-17 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added dir and files key to the response struct of aria2.tellStatus
	XML-RPC method.  The value associated with files key is the list
	of files. Its element is the same struct used in aria2.getFiles
	XML-RPC method.  Added uris key to the response struct of
	aria2.getFiles XML-RPC method.  The value associated with uris key
	is the list of URIs. Its element is the same struct used in
	aria2.getUris XML-RPC method.
	* doc/aria2c.1.txt
	* src/XmlRpcMethodImpl.cc
	* test/XmlRpcMethodTest.cc
2010-01-17 13:54:42 +00:00
Tatsuhiro Tsujikawa f2722cb870 2010-01-17 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added aria2.getSessionInfo XML-RPC method.  This method returns a
	struct containing Session ID, which is generated each time when
	aria2 is invoked.
	* doc/aria2c.1.txt
	* doc/xmlrpc/aria2rpc
	* src/DownloadEngine.cc
	* src/DownloadEngine.h
	* src/XmlRpcMethodFactory.cc
	* src/XmlRpcMethodImpl.cc
	* src/XmlRpcMethodImpl.h
	* test/XmlRpcMethodTest.cc
2010-01-17 11:55:22 +00:00
Tatsuhiro Tsujikawa f9c6c0ccd8 2010-01-17 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Now offset argument in aria2.tellWaiting and aria2.tellStopped
	accepts a negative integer.  'offset' == -1 points last download
	in the waiting queue and 'offset' == -2 points the download before
	the last download, and so on. The downloads in the response are in
	reversed order.
	* doc/aria2c.1.txt
	* src/XmlRpcMethodImpl.cc
	* src/XmlRpcMethodImpl.h
	* test/XmlRpcMethodTest.cc
2010-01-17 09:50:38 +00:00
Tatsuhiro Tsujikawa c022939c8f 2010-01-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Now --all-proxy, --http-proxy, --https-proxy and --ftp-proxy
	option accepts empty string "".  When "" is given, it erases
	previously defined proxy.
	* doc/aria2c.1.txt
	* src/OptionHandlerImpl.h
	* src/usage_text.h
	* test/OptionHandlerTest.cc
2010-01-15 09:04:47 +00:00
Tatsuhiro Tsujikawa 768f78f771 2010-01-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Replaced '/' and '_' with '_' in HTTP/FTP filename.
	* src/A2STR.cc
	* src/A2STR.h
	* src/FtpNegotiationCommand.cc
	* src/HttpResponseCommand.cc
	* src/util.cc
	* src/util.h
	* test/UtilTest.cc
2010-01-11 14:32:20 +00:00
Tatsuhiro Tsujikawa 4c89170488 2010-01-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Treat --dir="" as --dir="."
	* src/FtpNegotiationCommand.cc
	* src/HttpResponseCommand.cc
	* src/Metalink2RequestGroup.cc
	* src/UTMetadataPostDownloadHandler.cc
	* src/bittorrent_helper.cc
	* src/download_helper.cc
	* src/util.cc
	* src/util.h
	* test/UtilTest.cc
2010-01-11 14:01:20 +00:00
Tatsuhiro Tsujikawa d56459bb88 2010-01-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that causes segmentation fault if unknown option is
	put in aria2.conf file. BUG#2928303
	* src/OptionParser.cc
	* src/OptionParser.h
	* src/option_processing.cc
	* test/OptionParserTest.cc
2010-01-09 09:35:18 +00:00
Tatsuhiro Tsujikawa 4db349c1f3 2010-01-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Untabify. Fixed one line in copyright which is longer than 80
	columns.
	* src
	* test
2010-01-05 16:01:46 +00:00
Tatsuhiro Tsujikawa 606360779f 2009-12-27 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use info hash as a filename when saving BitTorrent metadata.
	* src/UTMetadataPostDownloadHandler.cc
	* test/UTMetadataPostDownloadHandlerTest.cc
2009-12-27 02:42:43 +00:00
Tatsuhiro Tsujikawa 1c331e901a 2009-12-26 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Defined method name in XmlRpcMethod subclasses.
	* src/XmlRpcMethodFactory.cc
	* src/XmlRpcMethodImpl.cc
	* src/XmlRpcMethodImpl.h
	* test/XmlRpcMethodTest.cc
2009-12-26 13:07:27 +00:00
Tatsuhiro Tsujikawa af20aea88c 2009-12-26 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added system.multicall XML-RPC method.
	* src/XmlRpcMethod.cc
	* src/XmlRpcMethod.h
	* src/XmlRpcMethodFactory.cc
	* src/XmlRpcMethodImpl.cc
	* src/XmlRpcMethodImpl.h
	* test/XmlRpcMethodTest.cc
2009-12-26 10:16:56 +00:00
Tatsuhiro Tsujikawa 838fcbbecd 2009-12-25 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Check structure depth when decoding.
	* src/bencode.cc
	* src/bencode.h
	* test/BencodeTest.cc
2009-12-25 14:53:11 +00:00
Tatsuhiro Tsujikawa 88bcc6e681 2009-12-24 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use AI_ADDRCONFIG flag if it is available. Refactored so that
	getaddrinfo calls are not scattered around. Unset AI_ADDRCONFIG
	when conducting unit tests because they fail if networking
	interface is not configured with IPv4 address.
	* src/NameResolver.cc
	* src/SocketCore.cc
	* src/SocketCore.h
	* src/a2netcompat.h
	* test/AllTest.cc
2009-12-24 14:59:47 +00:00
Tatsuhiro Tsujikawa 0190564ad3 2009-12-24 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed unit test error
	* test/UTMetadataPostDownloadHandlerTest.cc
2009-12-24 13:40:57 +00:00
Tatsuhiro Tsujikawa 2745d85597 2009-12-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added --bt-save-metadata option. When true is given, it saves
	metadata as .torrent file. This option has effect only when
	BitTorrent Magnet URI is used.  The filename is name in metadata
	with suffix .torrent. The directory to be saved is the same
	directory where download file is saved. If the same file already
	exists, metdata is not saved.
	* src/OptionHandlerFactory.cc
	* src/UTMetadataPostDownloadHandler.cc
	* src/UTMetadataPostDownloadHandler.h
	* src/message.h
	* src/prefs.cc
	* src/prefs.h
	* src/usage_text.h
	* test/UTMetadataDataExtensionMessageTest.cc
2009-12-23 13:21:12 +00:00
Tatsuhiro Tsujikawa dd98c64161 2009-12-22 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added changePosition XML-RPC method. It takes 3 parameters: gid,
	pos and how.  This method changes the position of download denoted
	by gid.  If how is POS_SET, it moves the download to a position
	relative to the beginning of the queue.  If how is POS_CUR, it
	moves the download to a position relative to the current
	position. If how is POS_END, it moves the download to a position
	relative to the end of the queue. If the destination position is
	less than 0 or beyond the end of the queue, it moves the download
	to the beginning or the end of the queue respectively.  Returns
	the destination position.
	* src/RequestGroupMan.cc
	* src/RequestGroupMan.h
	* src/XmlRpcMethodFactory.cc
	* src/XmlRpcMethodImpl.cc
	* src/XmlRpcMethodImpl.h
	* test/RequestGroupManTest.cc
	* test/XmlRpcMethodTest.cc
2009-12-21 15:17:34 +00:00
Tatsuhiro Tsujikawa e77e1ec24d 2009-12-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Sort _optionHandlers in OptionParser by name in ascending order.
	Use vector instead of deque for efficiency.
	* src/OptionHandler.h
	* src/OptionHandlerFactory.h
	* src/OptionParser.cc
	* src/OptionParser.h
	* src/version_usage.cc
	* test/OptionParserTest.cc
2009-12-20 14:25:51 +00:00
Tatsuhiro Tsujikawa 2952abf064 2009-12-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added following 2 keys, followedBy and belongsTo, to the response
	of tellStatus.

	followedBy: List of GIDs which are generated by the consequence of
	this download. For example, when aria2 downloaded Metalink file,
	it generates downloads described in it(see *--follow-metalink*
	option). This value is useful to track these auto generated
	downloads. If there is no such downloads, this key will not be
	included in the response.

	belongsTo: GID of a parent download. Some downloads are a part of
	another download.  For example, if a file in Metalink has
	BitTorrent resource, the download of .torrent is a part of that
	file.  If this download has no parent, this key will not be
	included in the response.
	* src/BtPostDownloadHandler.cc
	* src/DownloadResult.h
	* src/Metalink2RequestGroup.cc
	* src/MetalinkPostDownloadHandler.cc
	* src/RequestGroup.cc
	* src/RequestGroup.h
	* src/UTMetadataPostDownloadHandler.cc
	* src/XmlRpcMethodImpl.cc
	* src/XmlRpcMethodImpl.h
2009-12-20 09:49:43 +00:00
Tatsuhiro Tsujikawa 0734dfa770 2009-12-18 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Show info hash in Magnet URI in upper case letters in -S output.
	* src/bittorrent_helper.cc
	* test/BittorrentHelperTest.cc
2009-12-18 06:32:14 +00:00
Tatsuhiro Tsujikawa 6c3a3fefa2 2009-12-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Print Magnet URI in -S output.
	* src/AnnounceList.cc
	* src/bittorrent_helper.cc
	* src/bittorrent_helper.h
	* test/BittorrentHelperTest.cc
2009-12-10 12:52:59 +00:00
Tatsuhiro Tsujikawa 8cd1d845f2 2009-12-07 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that query parameter in magnet URI is not decoded.
	* src/magnet.cc
	* test/MagnetTest.cc
2009-12-07 13:01:25 +00:00
Tatsuhiro Tsujikawa 58bb1fa266 2009-12-07 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Specified defaultSize as an argument for easy testing.
	* src/util.cc
	* src/util.h
	* test/UtilTest.cc
2009-12-07 12:49:19 +00:00
Tatsuhiro Tsujikawa a41b927a57 2009-12-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Set default value for SIZE in --bt-prioritize-piece to 1MiB.
	* src/usage_text.h
	* src/util.cc
	* test/UtilTest.cc
2009-12-06 11:35:45 +00:00
Tatsuhiro Tsujikawa 9a6a73dd96 2009-12-05 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed compile error if ENABLE_BITTORRENT is undefined.
	* src/DefaultPieceStorage.cc
	* src/DefaultPieceStorage.h
	* src/PieceStorage.h
	* src/UnknownLengthPieceStorage.cc
	* src/UnknownLengthPieceStorage.h
	* test/MockPieceStorage.h
	* test/ProtocolDetectorTest.cc
	* test/XmlRpcMethodTest.cc
2009-12-05 11:35:18 +00:00
Tatsuhiro Tsujikawa 3a1a8868d5 2009-12-05 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use last 8 bytes of peer ID as 'key' parameter for tracker request.
	* src/DefaultBtAnnounce.cc
	* src/DefaultBtAnnounce.h
	* test/DefaultBtAnnounceTest.cc
2009-12-05 07:56:30 +00:00
Tatsuhiro Tsujikawa 625a102d1b 2009-12-04 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Halt metadata download immediately when metadata download is done.
	Don't wait unresponsive tracker.
	* src/ByteArrayDiskWriter.h
	* src/DefaultBtInteractive.cc
	* src/DefaultExtensionMessageFactory.cc
	* src/DefaultExtensionMessageFactory.h
	* src/PeerInteractionCommand.cc
	* src/UTMetadataDataExtensionMessage.cc
	* src/UTMetadataDataExtensionMessage.h
	* src/UTMetadataRequestExtensionMessage.cc
	* test/UTMetadataDataExtensionMessageTest.cc
	* test/UTMetadataRequestExtensionMessageTest.cc
2009-12-04 12:48:54 +00:00
Tatsuhiro Tsujikawa cccbeffce6 2009-11-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added extension_message_test_helper.h to aria2c_SOURCES.
	* test/Makefile.am
2009-11-29 06:56:04 +00:00
Tatsuhiro Tsujikawa e208302947 2009-11-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added option --bt-prioritize-piece.  This option instruct aria2 to
	try to download first and last pieces of each file first. The
	argument can contain 2 keywords:head and tail. To include both
	keywords, they must be separated by comma. These keywords can take
	one parameter, SIZE. For example , if head=SIZE is specified,
	pieces in the range of first SIZE bytes of each file get higher
	priority. tail=SIZE means the range of last SIZE bytes of each
	file. SIZE can include K or M(1K = 1024, 1M = 1024K).
	* src/DefaultPieceStorage.h
	* src/Makefile.am
	* src/OptionHandlerFactory.cc
	* src/OptionHandlerImpl.h
	* src/PriorityPieceSelector.cc
	* src/PriorityPieceSelector.h
	* src/RequestGroup.cc
	* src/prefs.cc
	* src/prefs.h
	* src/usage_text.h
	* src/util.cc
	* src/util.h
	* test/Makefile.am
	* test/MockPieceSelector.h
	* test/PriorityPieceSelectorTest.cc
	* test/UtilTest.cc
2009-11-29 06:43:38 +00:00
Tatsuhiro Tsujikawa 5f082a9ff4 2009-11-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
In Magnet URI with tr parameter, put each announce URI in separate
	tier.
	* src/bittorrent_helper.cc
	* test/BittorrentHelperTest.cc
2009-11-28 12:39:08 +00:00
Tatsuhiro Tsujikawa 6939be2765 2009-11-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Renamed ExtensionMessage::getBencodedData() as
	ExtensionMessage::getPayload()
	* src/BtExtendedMessage.cc
	* src/ExtensionMessage.h
	* src/HandshakeExtensionMessage.cc
	* src/HandshakeExtensionMessage.h
	* src/UTMetadataDataExtensionMessage.cc
	* src/UTMetadataDataExtensionMessage.h
	* src/UTMetadataRejectExtensionMessage.cc
	* src/UTMetadataRejectExtensionMessage.h
	* src/UTMetadataRequestExtensionMessage.cc
	* src/UTMetadataRequestExtensionMessage.h
	* src/UTPexExtensionMessage.cc
	* src/UTPexExtensionMessage.h
	* test/HandshakeExtensionMessageTest.cc
	* test/MockExtensionMessage.h
	* test/UTMetadataDataExtensionMessageTest.cc
	* test/UTMetadataRejectExtensionMessageTest.cc
	* test/UTMetadataRequestExtensionMessageTest.cc
	* test/UTPexExtensionMessageTest.cc
2009-11-28 12:32:07 +00:00
Tatsuhiro Tsujikawa 88bfe8b084 2009-11-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Call DownloadContext::setOwnerRequestGroup() in
	RequestGroup::setDownloadContext().
	* src/BtDependency.cc
	* src/RequestGroup.cc
	* src/RequestGroup.h
	* src/download_helper.cc
	* test/DefaultBtMessageDispatcherTest.cc
	* test/DefaultExtensionMessageFactoryTest.cc
	* test/HandshakeExtensionMessageTest.cc
2009-11-28 10:12:04 +00:00
Tatsuhiro Tsujikawa 339795311b 2009-11-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Accept BitTorrent Magnet URI in Metalink resource type bittorrent.
	Rewritten UTMetadataPostDownloadHandler. To create torrent data
	from metadata, use new metadata2Torrent() function.
	* src/BtDependency.cc
	* src/UTMetadataPostDownloadHandler.cc
	* src/bittorrent_helper.cc
	* src/bittorrent_helper.h
	* test/BittorrentHelperTest.cc
	* test/BtDependencyTest.cc
2009-11-28 09:58:49 +00:00
Tatsuhiro Tsujikawa 96205abc67 2009-11-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use createRequestGroupForUri to create the download for torrent
	file.
	* src/Metalink2RequestGroup.cc
	* test/Metalink2RequestGroupTest.cc
2009-11-28 09:21:12 +00:00
Tatsuhiro Tsujikawa a8d4fbad51 2009-11-27 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added --bt-max-peers option to changeOption XML-RPC method.
	* src/XmlRpcMethod.cc
	* src/XmlRpcMethodImpl.cc
	* test/XmlRpcMethodTest.cc
2009-11-27 13:07:08 +00:00
Tatsuhiro Tsujikawa 58f4e715e0 2009-11-27 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added test case for PREF_BT_REQUEST_PEER_SPEED_LIMIT
	* test/XmlRpcMethodTest.cc
2009-11-27 12:47:57 +00:00
Tatsuhiro Tsujikawa 46d9f2de63 2009-11-26 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug which causes segmentation fault with tellWaiting
	XML-RPC method when BitTorrent download is waiting.  The key of
	BtRegistry is changed from info hash to GID, because it is
	registered per RequestGroup, not info hash.
	* src/BtRegistry.cc
	* src/BtRegistry.h
	* src/BtSetup.cc
	* src/ConsoleStatCalc.cc
	* src/InitiatorMSEHandshakeCommand.cc
	* src/PeerInitiateConnectionCommand.cc
	* src/PeerInteractionCommand.cc
	* src/PeerInteractionCommand.h
	* src/PeerReceiveHandshakeCommand.cc
	* src/RequestGroup.cc
	* src/XmlRpcMethodImpl.cc
	* test/BtRegistryTest.cc
	* test/XmlRpcMethodTest.cc
2009-11-25 15:49:20 +00:00
Tatsuhiro Tsujikawa 3fa6ce55f4 2009-11-25 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that trackers in BitTorrent Magnet URI are not
	inherited to generated RequestGroup.
	* src/UTMetadataPostDownloadHandler.cc
	* test/UTMetadataPostDownloadHandlerTest.cc
2009-11-24 16:42:55 +00:00
Tatsuhiro Tsujikawa 656cbd16a0 2009-11-25 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Prepended "[METADATA]" before dn.
	* src/bittorrent_helper.cc
	* test/BittorrentHelperTest.cc
2009-11-24 16:39:52 +00:00
Tatsuhiro Tsujikawa 512be58217 2009-11-24 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Rewritten Magnet URI parser.
	* src/Makefile.am
	* src/ProtocolDetector.cc
	* src/bittorrent_helper.cc
	* src/bittorrent_helper.h
	* src/download_helper.cc
	* src/magnet.cc
	* src/magnet.h
	* test/BittorrentHelperTest.cc
	* test/MagnetTest.cc
	* test/Makefile.am
	* test/ProtocolDetectorTest.cc
2009-11-24 14:47:42 +00:00
Tatsuhiro Tsujikawa 894165171c 2009-11-24 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added Base32 encoded BitTorrent Magnet Link support.
	* src/Makefile.am
	* src/base32.cc
	* src/base32.h
	* src/bittorrent_helper.cc
	* test/Base32Test.cc
	* test/BittorrentHelperTest.cc
	* test/Makefile.am
2009-11-23 15:59:31 +00:00
Tatsuhiro Tsujikawa 6e8074c087 2009-11-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added BitTorrent Magnet Link support. Base32 encoded link is not
	supported yet.  Fixed typo in method name in RequestGroup.  In
	metadataGetMode, don't show "Your share ratio was ..." message.
	* src/DefaultBtInteractive.cc
	* src/DefaultBtInteractive.h
	* src/DownloadHandlerFactory.cc
	* src/DownloadHandlerFactory.h
	* src/HandshakeExtensionMessage.cc
	* src/Makefile.am
	* src/Metalink2RequestGroup.cc
	* src/PeerInteractionCommand.cc
	* src/RequestGroup.cc
	* src/RequestGroup.h
	* src/UTMetadataPostDownloadHandler.cc
	* src/UTMetadataPostDownloadHandler.h
	* src/download_helper.cc
	* test/HandshakeExtensionMessageTest.cc
	* test/Makefile.am
	* test/UTMetadataPostDownloadHandlerTest.cc
	* test/UTMetadataRejectExtensionMessageTest.cc
2009-11-23 13:17:48 +00:00
Tatsuhiro Tsujikawa c1730aeea9 2009-11-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed ut_metadata data handling. Implemented
	UTMetadataDataExtensionMessage::doReceivedAction().  Initialize
	PeerStorage in HandshakeExtensionMessage::doReceivedAction() when
	metadata_size is received.
	* src/DefaultExtensionMessageFactory.cc
	* src/DefaultExtensionMessageFactory.h
	* src/HandshakeExtensionMessage.cc
	* src/HandshakeExtensionMessage.h
	* src/UTMetadataDataExtensionMessage.cc
	* src/UTMetadataDataExtensionMessage.h
	* src/UTMetadataRequestExtensionMessage.cc
	* src/UTMetadataRequestFactory.cc
	* src/UTMetadataRequestFactory.h
	* src/UTMetadataRequestTracker.cc
	* src/UTMetadataRequestTracker.h
	* test/DefaultExtensionMessageFactoryTest.cc
	* test/HandshakeExtensionMessageTest.cc
	* test/MockBtMessage.h
	* test/UTMetadataDataExtensionMessageTest.cc
	* test/UTMetadataRequestExtensionMessageTest.cc
	* test/UTMetadataRequestFactoryTest.cc
	* test/UTMetadataRequestTrackerTest.cc
	* test/extension_message_test_helper.h
2009-11-22 15:31:47 +00:00
Tatsuhiro Tsujikawa c73d235ab8 2009-11-22 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added BitTorrent magnet link support to ProtocolDetector.
	* src/ProtocolDetector.cc
	* src/ProtocolDetector.h
	* test/ProtocolDetectorTest.cc
2009-11-22 14:54:51 +00:00
Tatsuhiro Tsujikawa 03b281f604 2009-11-22 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added setEndGamePieceNum() pure virtual function to PieceStorage.
	* src/DefaultPieceStorage.h
	* src/PieceStorage.h
	* src/UnknownLengthPieceStorage.h
	* test/MockPieceStorage.h
2009-11-22 14:42:59 +00:00
Tatsuhiro Tsujikawa 66e6191d10 2009-11-22 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added parseMagnetLink(). Hex encoded info hash is supported.
	Base32 encoded info hash is not supported yet.
	* src/bittorrent_helper.cc
	* src/bittorrent_helper.h
	* test/BittorrentHelperTest.cc
2009-11-22 14:35:35 +00:00
Tatsuhiro Tsujikawa e0d9798b94 2009-11-22 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added FromHex()
	* src/util.cc
	* src/util.h
	* test/UtilTest.cc
2009-11-22 14:30:51 +00:00
Tatsuhiro Tsujikawa 5130b5c1e0 2009-11-22 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added bencode::decode overload functions. They have extra argument
	'end', passed by reference. 'end' points to the beyond the last
	position of data used in decoding process.
	* src/bencode.cc
	* src/bencode.h
	* test/BencodeTest.cc
2009-11-22 13:26:32 +00:00
Tatsuhiro Tsujikawa 93968c4fa5 2009-11-21 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Initial support of Extension for Peers to Send Metadata
	Files(BEP9). Currently aria2 only serves metadata and cannot get
	metadata from swarm.
	* src/BtConstants.h
	* src/DefaultBtInteractive.cc
	* src/DefaultExtensionMessageFactory.cc
	* src/DefaultExtensionMessageFactory.h
	* src/ExtensionMessage.h
	* src/ExtensionMessageRegistry.h
	* src/HandshakeExtensionMessage.cc
	* src/HandshakeExtensionMessage.h
	* src/Makefile.am
	* src/PeerConnection.h
	* src/PeerInteractionCommand.cc
	* src/UTMetadataDataExtensionMessage.cc
	* src/UTMetadataDataExtensionMessage.h
	* src/UTMetadataExtensionMessage.cc
	* src/UTMetadataExtensionMessage.h
	* src/UTMetadataRejectExtensionMessage.cc
	* src/UTMetadataRejectExtensionMessage.h
	* src/UTMetadataRequestExtensionMessage.cc
	* src/UTMetadataRequestExtensionMessage.h
	* src/bittorrent_helper.cc
	* src/bittorrent_helper.h
	* test/BittorrentHelperTest.cc
	* test/DefaultExtensionMessageFactoryTest.cc
	* test/HandshakeExtensionMessageTest.cc
	* test/Makefile.am
	* test/UTMetadataDataExtensionMessageTest.cc
	* test/UTMetadataRejectExtensionMessageTest.cc
	* test/UTMetadataRequestExtensionMessageTest.cc
2009-11-20 15:42:25 +00:00
Tatsuhiro Tsujikawa 60e3e46c52 2009-11-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that slow server is not knocked down in favor of
	faster one.
	* src/AbstractCommand.cc
	* src/DefaultPieceStorage.cc
	* src/DefaultPieceStorage.h
	* src/PieceStorage.h
	* src/UnknownLengthPieceStorage.cc
	* src/UnknownLengthPieceStorage.h
	* test/MockPieceStorage.h
2009-11-20 07:47:42 +00:00
Tatsuhiro Tsujikawa 7b63e121c7 2009-11-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use dynamic_pointer_cast
	* test/BtPieceMessageTest.cc
	* test/BtRequestMessageTest.cc
	* test/DefaultBtRequestFactoryTest.cc
2009-11-15 13:25:44 +00:00
Tatsuhiro Tsujikawa f11adceba7 2009-11-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added testSetUrl20()
	* test/RequestTest.cc
2009-11-15 13:00:23 +00:00
Tatsuhiro Tsujikawa 7a94ae6af2 2009-11-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Rewritten Request::parseUrl()
	* src/Request.cc
	* test/RequestTest.cc
2009-11-12 14:50:23 +00:00
Tatsuhiro Tsujikawa 6c09ea69b8 2009-11-02 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed unused function.
	* test/DHTPeerAnnounceStorageTest.cc
2009-11-02 14:38:27 +00:00
Tatsuhiro Tsujikawa 20c8ce4128 2009-10-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed peerStorage from DHTPeerAnnounceEntry. It is unlikely to
	receive get_peers request for torrent which the client is now
	downloading.
	* src/BtSetup.cc
	* src/DHTPeerAnnounceEntry.cc
	* src/DHTPeerAnnounceEntry.h
	* src/DHTPeerAnnounceStorage.cc
	* src/DHTPeerAnnounceStorage.h
	* src/RequestGroup.cc
	* test/DHTPeerAnnounceEntryTest.cc
	* test/DHTPeerAnnounceStorageTest.cc
2009-10-31 11:54:54 +00:00
Tatsuhiro Tsujikawa 07dc5bdfee 2009-10-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Throw exception if binding listening port is failed.  Removed
	RequestGroupMan::getInitialCommand(). Use
	fillRequestGroupFromReserver() instead.  Delete commands for
	RequestGroup which has errors when it is being added.
	* src/BtSetup.cc
	* src/DownloadEngine.cc
	* src/DownloadEngine.h
	* src/DownloadEngineFactory.cc
	* src/MultiUrlRequestInfo.cc
	* src/RequestGroupMan.cc
	* src/RequestGroupMan.h
	* test/RequestGroupManTest.cc
2009-10-31 09:53:23 +00:00
Tatsuhiro Tsujikawa 14a47f43f8 2009-10-27 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
If user name is embedded but password is missing in URI, first
	resolve password using .netrc. If password is found in .netrc,
	then use it as password. If not, use the password specified in
	--ftp-passwd.
	* src/AuthConfigFactory.cc
	* src/Request.cc
	* src/Request.h
	* test/AuthConfigFactoryTest.cc
2009-10-27 12:58:46 +00:00
Tatsuhiro Tsujikawa e976b23728 2009-10-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Renamed Util.{cc,h} as util.{cc,h}
	* src/Util.cc
	* src/Util.h
	* src/util.cc
	* src/util.h
2009-10-22 15:35:33 +00:00
Tatsuhiro Tsujikawa c6035b2e24 2009-10-22 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Moved static functions in Util class to namespace util.
	* src
	* test
2009-10-22 15:09:00 +00:00
Tatsuhiro Tsujikawa 3349fe0811 2009-10-22 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Moved generateRandomData to Util.cc Moved flipBit to bitfield.cc.
	Moved generateRandomKey to bittorrent_helper.cc.
	* src/DHTBucket.cc
	* src/DHTGetPeersMessage.cc
	* src/DHTGetPeersReplyMessage.cc
	* src/DHTMessage.cc
	* src/DHTNode.cc
	* src/DHTTokenTracker.cc
	* src/DHTUtil.cc: Removed.
	* src/DHTUtil.h: Removed.
	* src/Makefile.am
	* src/Util.cc
	* src/Util.h
	* src/bitfield.h
	* src/bittorrent_helper.cc
	* src/bittorrent_helper.h
	* test/ARC4Test.cc
	* test/BNodeTest.cc
	* test/DHTAnnouncePeerMessageTest.cc
	* test/DHTAnnouncePeerReplyMessageTest.cc
	* test/DHTFindNodeMessageTest.cc
	* test/DHTFindNodeReplyMessageTest.cc
	* test/DHTGetPeersMessageTest.cc
	* test/DHTGetPeersReplyMessageTest.cc
	* test/DHTPingMessageTest.cc
	* test/DHTPingReplyMessageTest.cc
	* test/DHTTokenTrackerTest.cc
	* test/DHTUtilTest.cc: Removed.
	* test/Makefile.am
	* test/UtilTest.cc
2009-10-22 14:43:42 +00:00
Tatsuhiro Tsujikawa c8d34a46be 2009-10-18 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Replaced Util::slice() with split()
	* src/AbstractCommand.cc
	* src/CookieParser.cc
	* src/File.cc
	* src/HttpHeaderProcessor.cc
	* src/HttpRequest.cc
	* src/Metalink2RequestGroup.cc
	* src/MetalinkParserController.cc
	* src/Netrc.cc
	* src/NsCookieParser.cc
	* src/ParameterizedStringParser.cc
	* src/ServerStatMan.cc
	* src/UriListParser.cc
	* src/Util.cc
	* src/Util.h
	* src/bittorrent_helper.cc
	* test/UtilTest.cc
2009-10-18 12:31:07 +00:00
Tatsuhiro Tsujikawa 10e371c25a 2009-10-17 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that Netrc::parse() cannot recognize comment line.
	* src/Netrc.cc
	* src/Util.h
	* test/NetrcTest.cc
	* test/sample.netrc
2009-10-17 13:11:03 +00:00
Tatsuhiro Tsujikawa fb70a0e69c 2009-10-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added AC_FUNC_STRTOD and AC_TYPE_PID_T.  Check function for pow,
	utime. Check header for utime.h.
	* configure.ac
2009-10-10 08:16:44 +00:00
Tatsuhiro Tsujikawa f31fa015bb 2009-10-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added --install to ACLOCAL_AMFLAGS.
	Removed m4 from SUBDIRS.
	Updated automake 1.11 and autoconf 2.64.
	Replaced some obsolute macros with new one.
	* Makefile.am
	* configure.ac
	* m4/aria2_arg.m4
2009-10-10 07:54:39 +00:00
Tatsuhiro Tsujikawa 436448dd8a 2009-10-05 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Included version number in Peer ID and client version.  Peer ID
	now starts with "aria2/VERSION-", where VERSION is
	MAJOR.MINOR.MICRO. Client version is aria2/VERSION.
	* src/DefaultBtInteractive.cc
	* src/OptionHandlerFactory.cc
	* src/bittorrent_helper.cc
	* src/bittorrent_helper.h
	* src/main.cc
	* src/usage_text.h
	* test/BittorrentHelperTest.cc
2009-10-05 13:04:06 +00:00
Tatsuhiro Tsujikawa c0595d17ff 2009-10-04 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that the option values changed by XML-RPC
	method(changeOption and changeGlobalOption) are overwritten to the
	previous value by the next these request which doesn't contain
	that option value. Supporse max-download-limit is initially 0. You
	changed this value to 100K by changeOption. Then you issue
	changeOption request to change max-upload-limit to 50K. This
	second request doesn't contain xml-download-limit, so it is back
	to initial value, 0. Another improvement is that exception is
	thrown when changeOption and changeGlobalOption request contains
	option name which doesn't allowed in each request.
	* src/DownloadEngine.h
	* src/XmlRpcMethod.cc
	* src/XmlRpcMethod.h
	* src/XmlRpcMethodImpl.cc
	* src/download_helper.cc
	* src/download_helper.h
	* test/XmlRpcMethodTest.cc
2009-10-04 09:01:11 +00:00
Tatsuhiro Tsujikawa 99654e4160 2009-09-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Move all functions in PeerMessageUtil to bittorrent_helper.
	* src/BtBitfieldMessage.cc
	* src/BtBitfieldMessageValidator.h
	* src/BtExtendedMessage.cc
	* src/BtHandshakeMessage.cc
	* src/BtHandshakeMessageValidator.h
	* src/BtPieceMessage.cc
	* src/BtPieceMessageValidator.h
	* src/BtPortMessage.cc
	* src/DHTFindNodeReplyMessage.cc
	* src/DHTGetPeersReplyMessage.cc
	* src/DHTMessageFactoryImpl.cc
	* src/DHTRoutingTableDeserializer.cc
	* src/DHTRoutingTableSerializer.cc
	* src/DHTTokenTracker.cc
	* src/DefaultBtMessageFactory.cc
	* src/IndexBtMessage.cc
	* src/IndexBtMessage.h
	* src/IndexBtMessageValidator.h
	* src/Makefile.am
	* src/PeerMessageUtil.cc: Removed.
	* src/PeerMessageUtil.h: Removed.
	* src/RangeBtMessage.cc
	* src/RangeBtMessage.h
	* src/RangeBtMessageValidator.h
	* src/UTPexExtensionMessage.cc
	* src/ZeroBtMessage.cc
	* src/ZeroBtMessage.h
	* src/bittorrent_helper.cc
	* src/bittorrent_helper.h
	* test/BittorrentHelperTest.cc
	* test/BtAllowedFastMessageTest.cc
	* test/BtBitfieldMessageTest.cc
	* test/BtCancelMessageTest.cc
	* test/BtChokeMessageTest.cc
	* test/BtExtendedMessageTest.cc
	* test/BtHandshakeMessageTest.cc
	* test/BtHaveAllMessageTest.cc
	* test/BtHaveMessageTest.cc
	* test/BtHaveNoneMessageTest.cc
	* test/BtInterestedMessageTest.cc
	* test/BtNotInterestedMessageTest.cc
	* test/BtPieceMessageTest.cc
	* test/BtPortMessageTest.cc
	* test/BtRejectMessageTest.cc
	* test/BtRequestMessageTest.cc
	* test/BtSuggestPieceMessageTest.cc
	* test/BtUnchokeMessageTest.cc
	* test/DHTFindNodeReplyMessageTest.cc
	* test/DHTGetPeersReplyMessageTest.cc
	* test/DHTMessageFactoryImplTest.cc
	* test/DHTRoutingTableDeserializerTest.cc
	* test/DHTRoutingTableSerializerTest.cc
	* test/DefaultBtMessageFactoryTest.cc
	* test/DefaultExtensionMessageFactoryTest.cc
	* test/Makefile.am
	* test/PeerListProcessorTest.cc
	* test/PeerMessageUtilTest.cc: Removed.
	* test/UTPexExtensionMessageTest.cc
2009-09-29 14:52:42 +00:00
Tatsuhiro Tsujikawa 909b126180 2009-09-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed unused methods Util::fileCopy(), Util::rangedFileCopy(),
	Util::expandBuffer(), Util::unfoldRange(), Util::indexRange() and
	Util::httpGMT().
	* src/Util.cc
	* src/Util.h
	* test/UtilTest.cc
2009-09-23 06:47:56 +00:00
Tatsuhiro Tsujikawa 7cce6c46a8 2009-09-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added XML-RPC in -v Configuration output.
	* src/FeatureConfig.cc
	* src/FeatureConfig.h
	* test/FeatureConfigTest.cc
2009-09-20 09:31:42 +00:00
Tatsuhiro Tsujikawa ce25b54cfe 2009-08-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added support for IPv6 literal address in URI. Now aria2 can
	handle URI such as http://[::1]/
	* src/HttpRequest.cc
	* src/HttpRequest.h
	* src/Request.cc
	* src/Request.h
	* test/HttpRequestTest.cc
	* test/OptionHandlerTest.cc
	* test/RequestTest.cc
2009-08-30 15:05:30 +00:00
Tatsuhiro Tsujikawa 9077d5a985 2009-08-19 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Get comment, comment.utf-8, created by and creation date from
	.torrent file and print them in -S output.
	* src/bittorrent_helper.cc
	* src/bittorrent_helper.h
	* test/BittorrentHelperTest.cc
	* test/test.torrent
	* test/utf8.torrent
2009-08-19 14:09:19 +00:00
Tatsuhiro Tsujikawa 376e39a1f4 2009-08-18 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Show exact file size along in -S option output.
	* src/Util.h
	* src/bittorrent_helper.cc
	* test/UtilTest.cc
2009-08-18 14:36:52 +00:00
Tatsuhiro Tsujikawa 1731db1c60 2009-07-22 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the unit test error without sqlite3
	* test/CookieStorageTest.cc
2009-07-21 15:17:15 +00:00
Tatsuhiro Tsujikawa 7d9425adbf 2009-07-22 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the undefined reference error
	* test/HttpResponseTest.cc
2009-07-21 15:15:03 +00:00
Tatsuhiro Tsujikawa 682bafae0a 2009-07-13 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use option of each download to create AuthConfig instead of global
	option.	
	* src/AuthConfigFactory.cc
	* src/AuthConfigFactory.h
	* src/FtpNegotiationCommand.cc
	* src/HttpRequest.cc
	* src/HttpRequest.h
	* src/HttpRequestCommand.cc
	* src/HttpSkipResponseCommand.cc
	* src/MultiUrlRequestInfo.cc
	* test/AuthConfigFactoryTest.cc
	* test/FtpConnectionTest.cc
	* test/HttpRequestTest.cc
2009-07-14 12:37:34 +00:00
Tatsuhiro Tsujikawa d6a8fa5b10 2009-07-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Implemented getVersion xml-rpc method. This method returns struct
	which has 2 key-value pairs: "version" key is associated to the
	version of aria2, such as "1.5.0". "enabledFeatures" key is
	associated to the list of enabled features, such as "Async DNS",
	"BitTorrent".
	* src/FeatureConfig.h
	* src/XmlRpcMethodFactory.cc
	* src/XmlRpcMethodImpl.cc
	* src/XmlRpcMethodImpl.h
	* test/XmlRpcMethodTest.cc
2009-07-10 15:55:42 +00:00
Tatsuhiro Tsujikawa 5f966f6327 2009-07-07 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Disconnect seeder if client is also in seed state.
	* src/BtBitfieldMessage.cc
	* src/BtHaveAllMessage.cc
	* src/BtHaveMessage.cc
	* src/message.h
	* test/BtBitfieldMessageTest.cc
	* test/BtHaveAllMessageTest.cc
	* test/BtHaveMessageTest.cc
	* test/MockPieceStorage.h
2009-07-06 15:22:06 +00:00
Tatsuhiro Tsujikawa a7c222b8ab 2009-07-04 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Made URI reusing function work.
	* src/CreateRequestCommand.cc
	* src/FileEntry.cc
	* src/FileEntry.h
	* test/FileEntryTest.cc
2009-07-04 13:36:56 +00:00
Tatsuhiro Tsujikawa ffaeb271f9 2009-07-03 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Rewritten PeerStats handling in SegmentMan.cc.  Now we have 2 list
	of PeerStat in SegmentMan.  peerStats is used for calculating
	download speed. Therefore all active PeerStats should be in
	there. Another one is _fastestPeerStats and it only contains
	fastest PeerStat for each hostname/protocol pair. They are used
	for updating ServerStat.
	* src/DownloadCommand.cc
	* src/Request.h
	* src/RequestGroupMan.cc
	* src/SegmentMan.cc
	* src/SegmentMan.h
	* test/SegmentManTest.cc
2009-07-02 16:26:04 +00:00
Tatsuhiro Tsujikawa 01fdb2aaeb 2009-07-03 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Try all available addresses returned by DNS until it gets
	connected in HTTP(S)/FTP download
	* src/AbstractCommand.cc
	* src/AbstractCommand.h
	* src/AbstractProxyRequestCommand.cc
	* src/AbstractProxyRequestCommand.h
	* src/DNSCache.h
	* src/DownloadEngine.cc
	* src/DownloadEngine.h
	* src/FtpInitiateConnectionCommand.cc
	* src/FtpInitiateConnectionCommand.h
	* src/FtpNegotiationCommand.cc
	* src/FtpNegotiationCommand.h
	* src/HttpInitiateConnectionCommand.cc
	* src/HttpInitiateConnectionCommand.h
	* src/HttpRequestCommand.cc
	* src/HttpRequestCommand.h
	* src/InitiateConnectionCommand.cc
	* src/InitiateConnectionCommand.h
	* test/DNSCacheTest.cc
	* test/Makefile.am
	* test/SimpleDNSCacheTest.cc
2009-07-02 15:18:13 +00:00
Tatsuhiro Tsujikawa 30b65f79e7 2009-07-01 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Don't append "/" if base URI ends with "/".
	* src/bittorrent_helper.cc
	* test/url-list-multiFile.torrent
2009-06-30 17:20:34 +00:00
Tatsuhiro Tsujikawa cf19dce855 2009-07-01 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
HTTP pipelining is now working. Fixed Segmention fault in
	BitfieldMan's copy ctor.	
	* src/AbstractCommand.cc
	* src/BitfieldMan.cc
	* src/BitfieldMan.h
	* src/DownloadCommand.cc
	* src/HttpDownloadCommand.cc
	* src/HttpRequest.cc
	* src/SegmentMan.cc
	* src/SegmentMan.h
	* test/BitfieldManTest.cc
	* test/SegmentManTest.cc
2009-06-30 17:03:57 +00:00
Tatsuhiro Tsujikawa cece2bc896 2009-06-30 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed ServerHost. Same functionality is implemented using
	FileEntry's in-flight Request objects.
	* src/AbstractCommand.cc
	* src/BtDependency.cc
	* src/CreateRequestCommand.cc
	* src/FileEntry.cc
	* src/FileEntry.h
	* src/FtpNegotiationCommand.cc
	* src/HttpResponseCommand.cc
	* src/Makefile.am
	* src/Metalink2RequestGroup.cc
	* src/RequestGroup.cc
	* src/RequestGroup.h
	* src/ServerHost.cc: Removed
	* src/ServerHost.h: Removed
	* test/BtDependencyTest.cc
	* test/FileEntryTest.cc
	* test/RequestGroupTest.cc
2009-06-29 16:43:41 +00:00
Tatsuhiro Tsujikawa c4d79d7160 2009-06-30 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Rewritten PeerStat handling. In the previous implementation,
	faster command tries to find slower command. In this new
	implementation, slower command tries to find faster command.
	PeerStat is now created in each HTTP/FTP request to get download
	rate correctly. If the download range is small, the download rate
	tends to small and this will occur at the later stage of download.
	* src/AbstractCommand.cc
	* src/DownloadCommand.cc
	* src/FileEntry.cc
	* src/FileEntry.h
	* src/Request.cc
	* src/Request.h
	* src/RequestGroup.h
	* src/RequestGroupMan.cc
	* src/SegmentMan.cc
	* src/SegmentMan.h
	* test/SegmentManTest.cc
2009-06-29 15:18:21 +00:00
Tatsuhiro Tsujikawa e82f870fdc 2009-06-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed _uris from RequestGroup. All functions that refer to _uris
	were moved to FileEntry. Exit status code are now defined in
	DownloadResultCode.h.
	* src/AbstractCommand.cc
	* src/AdaptiveURISelector.cc
	* src/AdaptiveURISelector.h
	* src/AutoSaveCommand.cc
	* src/BtPostDownloadHandler.cc
	* src/CheckIntegrityDispatcherCommand.cc
	* src/CookieStorage.cc
	* src/DHTAutoSaveCommand.cc
	* src/DHTBucketRefreshCommand.cc
	* src/DHTEntryPointNameResolveCommand.cc
	* src/DHTInteractionCommand.cc
	* src/DHTPeerAnnounceCommand.cc
	* src/DHTTokenUpdateCommand.cc
	* src/DlAbortEx.h
	* src/DlRetryEx.h
	* src/DownloadCommand.cc
	* src/DownloadContext.h
	* src/DownloadFailureException.h
	* src/DownloadResult.h
	* src/DownloadResultCode.h
	* src/FeedbackURISelector.cc
	* src/FeedbackURISelector.h
	* src/FileEntry.cc
	* src/FileEntry.h
	* src/FtpNegotiationCommand.cc
	* src/HttpListenCommand.cc
	* src/HttpResponseCommand.cc
	* src/HttpServerResponseCommand.cc
	* src/HttpSkipResponseCommand.cc
	* src/InOrderURISelector.cc
	* src/InOrderURISelector.h
	* src/Makefile.am
	* src/Makefile.in
	* src/Metalink2RequestGroup.cc
	* src/MultiUrlRequestInfo.cc
	* src/MultiUrlRequestInfo.h
	* src/OptionHandlerFactory.cc
	* src/PeerListenCommand.cc
	* src/RecoverableException.h
	* src/RequestGroup.cc
	* src/RequestGroup.h
	* src/RequestGroupMan.cc
	* src/RequestGroupMan.h
	* src/TimedHaltCommand.cc
	* src/TrackerWatcherCommand.cc
	* src/URIResult.cc
	* src/URIResult.h
	* src/URISelector.h
	* src/XmlRpcMethodImpl.cc
	* src/bittorrent_helper.cc
	* src/bittorrent_helper.h
	* src/download_helper.cc
	* src/main.cc
	* src/option_processing.cc
	* test/BtDependencyTest.cc
	* test/BtPostDownloadHandlerTest.cc
	* test/CookieStorageTest.cc
	* test/DefaultBtMessageDispatcherTest.cc
	* test/DownloadHandlerFactoryTest.cc
	* test/DownloadHelperTest.cc
	* test/FeedbackURISelectorTest.cc
	* test/FileEntryTest.cc
	* test/InOrderURISelectorTest.cc
	* test/Metalink2RequestGroupTest.cc
	* test/MetalinkPostDownloadHandlerTest.cc
	* test/RequestGroupManTest.cc
	* test/RequestGroupTest.cc
	* test/XmlRpcMethodTest.cc
2009-06-29 08:42:58 +00:00
Tatsuhiro Tsujikawa 8122399ca7 2009-06-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed MockBtContext.h
	* test/Makefile.am
2009-06-28 10:50:45 +00:00
Tatsuhiro Tsujikawa 5699b67526 2009-06-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Rewritten DownloadContext and removed SingleFileDownloadContext
	and BtContext and its derived classes. BitTorrent specific
	attributes are now set by DownloadContext::setAttribute() with key
	bittorrent::BITTORRENT.
	* src/AbstractBtMessage.cc
	* src/AbstractBtMessage.h
	* src/AbstractCommand.cc
	* src/AbstractCommand.h
	* src/AbstractProxyRequestCommand.cc
	* src/AbstractProxyResponseCommand.cc
	* src/ActivePeerConnectionCommand.cc
	* src/ActivePeerConnectionCommand.h
	* src/AnnounceList.cc
	* src/BtCheckIntegrityEntry.cc
	* src/BtConstants.h
	* src/BtContext.h: Removed
	* src/BtDependency.cc
	* src/BtExtendedMessage.cc
	* src/BtPieceMessage.cc
	* src/BtPieceMessage.h
	* src/BtPostDownloadHandler.cc
	* src/BtRegistry.cc
	* src/BtRegistry.h
	* src/BtSetup.cc
	* src/CheckIntegrityCommand.cc
	* src/CheckIntegrityEntry.cc
	* src/ChecksumCheckIntegrityEntry.cc
	* src/ConsoleStatCalc.cc
	* src/ContentTypeRequestGroupCriteria.cc
	* src/DHTGetPeersCommand.cc
	* src/DHTGetPeersCommand.h
	* src/DHTPeerLookupTask.cc
	* src/DHTPeerLookupTask.h
	* src/DHTTaskFactory.h
	* src/DHTTaskFactoryImpl.cc
	* src/DHTTaskFactoryImpl.h
	* src/DefaultBtAnnounce.cc
	* src/DefaultBtAnnounce.h
	* src/DefaultBtContext.cc: Removed
	* src/DefaultBtContext.h: Removed
	* src/DefaultBtInteractive.cc
	* src/DefaultBtInteractive.h
	* src/DefaultBtMessageDispatcher.cc
	* src/DefaultBtMessageDispatcher.h
	* src/DefaultBtMessageFactory.cc
	* src/DefaultBtMessageFactory.h
	* src/DefaultBtMessageReceiver.cc
	* src/DefaultBtMessageReceiver.h
	* src/DefaultBtProgressInfoFile.cc
	* src/DefaultBtRequestFactory.cc
	* src/DefaultBtRequestFactory.h
	* src/DefaultExtensionMessageFactory.cc
	* src/DefaultExtensionMessageFactory.h
	* src/DefaultPeerStorage.cc
	* src/DefaultPeerStorage.h
	* src/DefaultPieceStorage.cc
	* src/DefaultSegmentManFactory.cc
	* src/DiskAdaptor.cc
	* src/DiskAdaptor.h
	* src/DownloadContext.cc
	* src/DownloadContext.h
	* src/DownloadEngine.cc
	* src/DownloadEngineFactory.cc
	* src/DownloadHandler.cc
	* src/DownloadResult.h
	* src/FileAllocationCommand.cc
	* src/FileAllocationDispatcherCommand.cc
	* src/FileAllocationEntry.cc
	* src/FileEntry.h
	* src/FillRequestGroupCommand.cc
	* src/FtpDownloadCommand.cc
	* src/FtpFinishDownloadCommand.cc
	* src/FtpInitiateConnectionCommand.cc
	* src/FtpNegotiationCommand.cc
	* src/FtpTunnelRequestCommand.cc
	* src/FtpTunnelResponseCommand.cc
	* src/HandshakeExtensionMessage.cc
	* src/HandshakeExtensionMessage.h
	* src/HaveEraseCommand.cc
	* src/HttpDownloadCommand.cc
	* src/HttpInitiateConnectionCommand.cc
	* src/HttpProxyRequestCommand.cc
	* src/HttpProxyResponseCommand.cc
	* src/HttpRequest.cc
	* src/HttpRequest.h
	* src/HttpRequestCommand.cc
	* src/HttpResponseCommand.cc
	* src/HttpServerBodyCommand.cc
	* src/HttpServerCommand.cc
	* src/HttpSkipResponseCommand.cc
	* src/InitiateConnectionCommandFactory.cc
	* src/InitiatorMSEHandshakeCommand.cc
	* src/InitiatorMSEHandshakeCommand.h
	* src/IteratableChecksumValidator.cc
	* src/IteratableChecksumValidator.h
	* src/IteratableChunkChecksumValidator.cc
	* src/MSEHandshake.cc
	* src/MSEHandshake.h
	* src/Makefile.am
	* src/Makefile.in
	* src/Metalink2RequestGroup.cc
	* src/MetalinkPostDownloadHandler.cc
	* src/MultiDiskAdaptor.cc
	* src/MultiDiskAdaptor.h
	* src/MultiFileAllocationIterator.cc
	* src/MultiUrlRequestInfo.cc
	* src/PeerChokeCommand.cc
	* src/PeerChokeCommand.h
	* src/PeerInitiateConnectionCommand.cc
	* src/PeerInitiateConnectionCommand.h
	* src/PeerInteractionCommand.cc
	* src/PeerInteractionCommand.h
	* src/PeerReceiveHandshakeCommand.cc
	* src/PieceHashCheckIntegrityEntry.cc
	* src/RealtimeCommand.cc
	* src/ReceiverMSEHandshakeCommand.cc
	* src/RequestGroup.cc
	* src/RequestGroup.h
	* src/RequestGroupEntry.cc
	* src/RequestGroupMan.cc
	* src/SeedCheckCommand.cc
	* src/SeedCheckCommand.h
	* src/SegmentMan.cc
	* src/ShareRatioSeedCriteria.h
	* src/SingleFileDownloadContext.cc: Removed
	* src/SingleFileDownloadContext.h: Removed
	* src/SleepCommand.cc
	* src/StreamCheckIntegrityEntry.cc
	* src/TrackerWatcherCommand.cc
	* src/TrackerWatcherCommand.h
	* src/UnknownLengthPieceStorage.cc
	* src/Util.cc
	* src/Util.h
	* src/XmlRpcMethodImpl.cc
	* src/bittorrent_helper.cc
	* src/bittorrent_helper.h
	* src/download_helper.cc
	* src/main.cc
	* src/option_processing.cc
	* test/BitfieldManTest.cc
	* test/BittorrentHelperTest.cc
	* test/BtCancelMessageTest.cc
	* test/BtChokeMessageTest.cc
	* test/BtDependencyTest.cc
	* test/BtPieceMessageTest.cc
	* test/BtPostDownloadHandlerTest.cc
	* test/BtRegistryTest.cc
	* test/BtRejectMessageTest.cc
	* test/BtRequestMessageTest.cc
	* test/DHTPeerAnnounceStorageTest.cc
	* test/DefaultBtAnnounceTest.cc
	* test/DefaultBtContextTest.cc: Removed
	* test/DefaultBtMessageDispatcherTest.cc
	* test/DefaultBtMessageFactoryTest.cc
	* test/DefaultBtProgressInfoFileTest.cc
	* test/DefaultBtRequestFactoryTest.cc
	* test/DefaultExtensionMessageFactoryTest.cc
	* test/DefaultPeerStorageTest.cc
	* test/DefaultPieceStorageTest.cc
	* test/DirectDiskAdaptorTest.cc
	* test/DownloadContextTest.cc
	* test/DownloadHandlerFactoryTest.cc
	* test/DownloadHelperTest.cc
	* test/HandshakeExtensionMessageTest.cc
	* test/HttpRequestTest.cc
	* test/HttpResponseTest.cc
	* test/IteratableChecksumValidatorTest.cc
	* test/IteratableChunkChecksumValidatorTest.cc
	* test/MSEHandshakeTest.cc
	* test/Makefile.am
	* test/Makefile.in
	* test/Metalink2RequestGroupTest.cc
	* test/MetalinkPostDownloadHandlerTest.cc
	* test/MockBtContext.h: Removed
	* test/MockDHTTaskFactory.h
	* test/MockDownloadContext.h: Removed
	* test/MockPieceStorage.h
	* test/MultiDiskAdaptorTest.cc
	* test/MultiFileAllocationIteratorTest.cc
	* test/RequestGroupManTest.cc
	* test/RequestGroupTest.cc
	* test/SegmentManTest.cc
	* test/ShareRatioSeedCriteriaTest.cc
	* test/SingleFileDownloadContextTest.cc: Removed
	* test/UtilTest.cc
	* test/XmlRpcMethodTest.cc
2009-06-28 10:37:15 +00:00
Tatsuhiro Tsujikawa 90471d6805 2009-06-24 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added experimental support of WEB-Seeding for multi-file torrent.
	Due to fundamental changes in file handling in HTTP/FTP code, many
	functions are not working: PeerStat, ServerHost, proxy..etc
	* src/AbstractCommand.cc
	* src/AbstractCommand.h
	* src/BitfieldMan.cc
	* src/BitfieldMan.h
	* src/CreateRequestCommand.cc
	* src/CreateRequestCommand.h
	* src/DefaultPieceStorage.cc
	* src/DefaultPieceStorage.h
	* src/DownloadCommand.cc
	* src/DownloadCommand.h
	* src/DownloadContext.cc
	* src/DownloadContext.h
	* src/FileEntry.cc
	* src/FileEntry.h
	* src/FtpDownloadCommand.cc
	* src/FtpDownloadCommand.h
	* src/FtpFinishDownloadCommand.cc
	* src/FtpFinishDownloadCommand.h
	* src/FtpInitiateConnectionCommand.cc
	* src/FtpInitiateConnectionCommand.h
	* src/FtpNegotiationCommand.cc
	* src/FtpNegotiationCommand.h
	* src/FtpTunnelResponseCommand.cc
	* src/HttpDownloadCommand.cc
	* src/HttpDownloadCommand.h
	* src/HttpInitiateConnectionCommand.cc
	* src/HttpInitiateConnectionCommand.h
	* src/HttpProxyResponseCommand.cc
	* src/HttpRequest.cc
	* src/HttpRequest.h
	* src/HttpRequestCommand.cc
	* src/HttpRequestCommand.h
	* src/HttpResponseCommand.cc
	* src/HttpResponseCommand.h
	* src/HttpSkipResponseCommand.cc
	* src/HttpSkipResponseCommand.h
	* src/InitiateConnectionCommand.cc
	* src/InitiateConnectionCommand.h
	* src/InitiateConnectionCommandFactory.cc
	* src/InitiateConnectionCommandFactory.h
	* src/Makefile.am
	* src/PieceStorage.h
	* src/RequestGroup.cc
	* src/RequestGroup.h
	* src/RequestGroupMan.cc
	* src/SegmentMan.cc
	* src/SegmentMan.h
	* src/SingleFileDownloadContext.h
	* src/StreamFileAllocationEntry.cc
	* src/TrackerWatcherCommand.cc
	* src/UnknownLengthPieceStorage.cc
	* src/UnknownLengthPieceStorage.h
	* src/array_fun.h
	* src/bitfield.h
	* src/download_helper.cc
	* test/DownloadContextTest.cc
	* test/Makefile.am
	* test/MockDownloadContext.h
2009-06-23 15:35:45 +00:00
Tatsuhiro Tsujikawa 6b2ab3ffc0 2009-06-24 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added tellWaiting XML-RPC method.
	* src/SingleFileDownloadContext.cc
	* src/XmlRpcMethodFactory.cc
	* src/XmlRpcMethodImpl.cc
	* src/XmlRpcMethodImpl.h
	* test/XmlRpcMethodTest.cc
2009-06-23 15:14:24 +00:00
Tatsuhiro Tsujikawa 100ed86b5c 2009-06-24 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Updated CookieStorageTest
	* test/CookieStorageTest.cc
2009-06-23 15:12:08 +00:00
Tatsuhiro Tsujikawa eaf5217de7 2009-06-17 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Rewritten BtRegistry
	* src/BtRegistry.cc
	* src/BtRegistry.h
	* src/BtSetup.cc
	* src/ConsoleStatCalc.cc
	* src/PeerInteractionCommand.cc
	* src/PeerReceiveHandshakeCommand.cc
	* src/ReceiverMSEHandshakeCommand.cc
	* src/RequestGroup.cc
	* src/XmlRpcMethodImpl.cc
	* test/BtRegistryTest.cc
2009-06-17 11:51:44 +00:00
Tatsuhiro Tsujikawa a28f19befb 2009-06-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Throw an exception if position is less than 0.
	* src/XmlRpcMethodImpl.cc
	* test/XmlRpcMethodTest.cc
2009-06-14 11:29:46 +00:00
Tatsuhiro Tsujikawa b345f76607 2009-06-07 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added unit tests for strjoin, strconcat and strappend.
	* test/a2functionalTest.cc
2009-06-07 07:50:50 +00:00
Tatsuhiro Tsujikawa c42cea4bcd 2009-06-07 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Compile bencode.cc and BencodeTest.cc only if BitTorrent support
	is enabled.
	* src/Makefile.am
	* test/Makefile.am
2009-06-07 05:36:44 +00:00
Tatsuhiro Tsujikawa b922020985 2009-06-07 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added countSeeder() function which counts seeder in the given
	iterator range. Use it in ConsoleStatCalc and XmlRpcMethodImpl.
	* src/ConsoleStatCalc.cc
	* src/Peer.h
	* src/XmlRpcMethodImpl.cc
	* test/PeerTest.cc
2009-06-07 05:34:10 +00:00
Tatsuhiro Tsujikawa ff75691da6 2009-06-01 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added utf8.torrent to EXTRA_DIST
	* test/Makefile.am
2009-05-31 15:15:35 +00:00
Tatsuhiro Tsujikawa 0373ae325e 2009-05-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added test case for XmlRpcProcessor to fail to parse malformed
	document.
	* test/XmlRpcRequestProcessorTest.cc
2009-05-31 08:02:42 +00:00
Tatsuhiro Tsujikawa 960bab86c7 2009-05-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added 'position' parameter to addUri, addTorrent and addMetalink
	xml-rpc method.
	* src/RequestGroupMan.cc
	* src/RequestGroupMan.h
	* src/XmlRpcMethodImpl.cc
	* test/XmlRpcMethodTest.cc
2009-05-30 13:55:14 +00:00
Tatsuhiro Tsujikawa 918c6bf38d 2009-05-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed Peer.cc from compile source list when --disable-bittorrent
	is specified.  Added #ifdef ENABLE_BITTORRENT guard to methods that
	takes Peer.
	* src/DefaultPieceStorage.cc
	* src/DefaultPieceStorage.h
	* src/Makefile.am
	* src/PieceStorage.h
	* src/UnknownLengthPieceStorage.cc
	* src/UnknownLengthPieceStorage.h
	* test/MockPieceStorage.h
2009-05-29 12:32:17 +00:00
Tatsuhiro Tsujikawa 30f362319e 2009-05-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed compile error without BitTorrent and Metalink support.
	* src/XmlRpcMethod.cc
	* src/XmlRpcMethodFactory.cc
	* src/XmlRpcMethodImpl.cc
	* src/XmlRpcMethodImpl.h
	* test/XmlRpcMethodTest.cc
2009-05-27 17:27:05 +00:00
Tatsuhiro Tsujikawa 41df4b5e28 2009-05-27 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use name.utf-8 and path.utf-8 key in higher priority than name and
	path key respectively when persing .torrent file.
	* src/BtContext.cc
	* src/BtContext.h
	* src/DefaultBtContext.cc
	* test/DefaultBtContextTest.cc
	* test/utf8.torrent
2009-05-26 15:28:48 +00:00
Tatsuhiro Tsujikawa a933438401 2009-05-24 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed g++-4.4 compiler warning: dereferencing type-punned pointer
	will break strict-aliasing rules
	* src/PeerConnection.cc
	* test/DHTRoutingTableSerializerTest.cc
2009-05-23 15:48:20 +00:00
Tatsuhiro Tsujikawa 50060985c3 2009-05-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed PKG_CONFIG variable in sqlite3.m4, which conflicts the
	variable in pkg.m4. Use PKG_CHECK_MODULES instead of hand-crafted
	scripts. Renamed SQLITE3_CPPFLAGS as SQLITE3_CFLAGS since
	PKG_CHECK_MODULES macro uses latter name.	
	* m4/sqlite3.m4
	* src/Makefile.am
	* test/Makefile.am
2009-05-23 06:20:29 +00:00
Tatsuhiro Tsujikawa aafbe6f74b 2009-05-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Since upcoming libgnutls 2.8 doesn't have libgnutls-config, Check
	presence of libgnutls using pkg-config first. If it fails, fall
	back to old macro libgnutls.m4.
	* configure.ac
2009-05-23 05:20:21 +00:00
Tatsuhiro Tsujikawa 383b12d7f1 2009-05-22 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added --save-cookies option.
	* src/Cookie.cc
	* src/Cookie.h
	* src/CookieStorage.cc
	* src/CookieStorage.h
	* src/MultiUrlRequestInfo.cc
	* src/OptionHandlerFactory.cc
	* src/prefs.cc
	* src/prefs.h
	* src/usage_text.h
	* test/CookieStorageTest.cc
	* test/CookieTest.cc
2009-05-22 14:51:57 +00:00
Tatsuhiro Tsujikawa 38731352ff 2009-05-22 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed test error
	* test/BencodeTest.cc
2009-05-22 13:38:41 +00:00
Tatsuhiro Tsujikawa fbb2613379 2009-05-22 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added unit tests.
	* test/XmlRpcMethodTest.cc
2009-05-22 12:28:32 +00:00
Tatsuhiro Tsujikawa 20e215047c 2009-05-18 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added source filename(__FILE__) and line number(__LINE__) to
	exception message.	
	* src/AbstractCommand.cc
	* src/AbstractDiskWriter.cc
	* src/AbstractProxyResponseCommand.cc
	* src/BDE.h
	* src/BtAllowedFastMessage.cc
	* src/BtHandshakeMessageValidator.h
	* src/BtHaveAllMessage.cc
	* src/BtHaveNoneMessage.cc
	* src/BtPieceMessage.cc
	* src/BtRejectMessage.cc
	* src/ChunkedDecoder.cc
	* src/CookieStorage.cc
	* src/DHTAnnouncePeerMessage.cc
	* src/DHTEntryPointNameResolveCommand.cc
	* src/DHTMessageFactoryImpl.cc
	* src/DHTMessageTracker.cc
	* src/DHTRoutingTableDeserializer.cc
	* src/DHTRoutingTableSerializer.cc
	* src/DHTSetup.cc
	* src/DHTTokenTracker.cc
	* src/DefaultBtAnnounce.cc
	* src/DefaultBtContext.cc
	* src/DefaultBtInteractive.cc
	* src/DefaultBtMessageFactory.cc
	* src/DefaultBtProgressInfoFile.cc
	* src/DefaultExtensionMessageFactory.cc
	* src/DlAbortEx.h
	* src/DlRetryEx.h
	* src/DownloadCommand.cc
	* src/DownloadEngineFactory.cc
	* src/DownloadFailureException.h
	* src/Exception.cc
	* src/Exception.h
	* src/ExpatMetalinkProcessor.cc
	* src/ExpatXmlRpcRequestProcessor.cc
	* src/FallocFileAllocationIterator.cc
	* src/FatalException.h
	* src/FtpConnection.cc
	* src/FtpFinishDownloadCommand.cc
	* src/FtpInitiateConnectionCommand.cc
	* src/FtpNegotiationCommand.cc
	* src/GZipDecoder.cc
	* src/HandshakeExtensionMessage.cc
	* src/HttpConnection.cc
	* src/HttpHeaderProcessor.cc
	* src/HttpInitiateConnectionCommand.cc
	* src/HttpResponse.cc
	* src/HttpResponseCommand.cc
	* src/HttpServer.cc
	* src/HttpSkipResponseCommand.cc
	* src/InitiateConnectionCommandFactory.cc
	* src/IteratableChunkChecksumValidator.cc
	* src/LibgcryptARC4Context.h
	* src/LibgcryptARC4Decryptor.h
	* src/LibgcryptARC4Encryptor.h
	* src/LibgcryptDHKeyExchange.h
	* src/LibgnutlsTLSContext.cc
	* src/LibsslARC4Context.h
	* src/LibsslARC4Decryptor.h
	* src/LibsslARC4Encryptor.h
	* src/LibsslDHKeyExchange.h
	* src/LibsslTLSContext.cc
	* src/MSEHandshake.cc
	* src/MessageDigestHelper.cc
	* src/MetalinkHelper.cc
	* src/MultiDiskAdaptor.cc
	* src/NameMatchOptionHandler.h
	* src/NameResolver.cc
	* src/Netrc.cc
	* src/NsCookieParser.cc
	* src/OptionHandlerException.cc
	* src/OptionHandlerException.h
	* src/OptionHandlerImpl.h
	* src/OptionParser.cc
	* src/ParameterizedStringParser.cc
	* src/PeerAbstractCommand.cc
	* src/PeerConnection.cc
	* src/PeerMessageUtil.cc
	* src/PeerReceiveHandshakeCommand.cc
	* src/Platform.cc
	* src/ReceiverMSEHandshakeCommand.cc
	* src/RecoverableException.h
	* src/RequestGroup.cc
	* src/SimpleLogger.cc
	* src/SocketCore.cc
	* src/Sqlite3MozCookieParser.cc
	* src/UTPexExtensionMessage.cc
	* src/Util.cc
	* src/XML2SAXMetalinkProcessor.cc
	* src/Xml2XmlRpcRequestProcessor.cc
	* src/XmlRpcMethodImpl.cc
	* src/bencode.cc
	* src/download_helper.cc
	* src/messageDigest.h
	* test/ExceptionTest.cc
	* test/TestUtil.cc
2009-05-18 15:07:15 +00:00
Tatsuhiro Tsujikawa 2b6e87b42e 2009-05-16 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added 2files.metalink to EXTRA_DIST
	* test/Makefile.am
2009-05-16 07:45:04 +00:00
Tatsuhiro Tsujikawa bead3edccb 2009-05-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added missing 2files.metalink
	* test/2files.metalink
2009-05-15 10:15:52 +00:00
Tatsuhiro Tsujikawa 672b70f6c9 2009-05-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added tests for addTorrent and addMetalink command.
	* test/TestUtil.cc
	* test/TestUtil.h
	* test/XmlRpcMethodTest.cc
2009-05-15 05:20:11 +00:00
Tatsuhiro Tsujikawa 3e2ccbf359 2009-05-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added changeGlobalOption command. Currently,
	max-overall-download-limit and max-overall-upload-limit option are
	available.
	* src/RequestGroupMan.h
	* src/XmlRpcMethod.cc
	* src/XmlRpcMethod.h
	* src/XmlRpcMethodFactory.cc
	* src/XmlRpcMethodImpl.cc
	* src/XmlRpcMethodImpl.h
	* test/XmlRpcMethodTest.cc
2009-05-14 15:44:59 +00:00
Tatsuhiro Tsujikawa 850458f7b1 2009-05-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added changeOption command. Currently, max-download-limit,
	max-upload-limit option are available in this command.
	* src/RequestGroup.h
	* src/XmlRpcMethod.cc
	* src/XmlRpcMethod.h
	* src/XmlRpcMethodFactory.cc
	* src/XmlRpcMethodImpl.cc
	* src/XmlRpcMethodImpl.h
	* test/XmlRpcMethodTest.cc
2009-05-14 15:23:50 +00:00
Tatsuhiro Tsujikawa 92b3f57ac9 2009-05-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added XmlRpcResponse class. XmlRpcMethod::execute() now returns
	XmlRpcResponse.
	* src/HttpServerBodyCommand.cc
	* src/Makefile.am
	* src/XmlRpcMethod.cc
	* src/XmlRpcMethod.h
	* src/XmlRpcMethodImpl.cc
	* src/XmlRpcResponse.cc
	* src/XmlRpcResponse.h
	* test/XmlRpcMethodTest.cc
2009-05-14 12:59:52 +00:00
Tatsuhiro Tsujikawa 5983e3e9d9 2009-05-13 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added "downloadSpeed" and uploadSpeed" key in getPeers response.	
	* src/DefaultPeerStorage.cc
	* src/DefaultPeerStorage.h
	* src/PeerStorage.h
	* src/XmlRpcMethodImpl.cc
	* test/MockPeerStorage.h
2009-05-12 16:16:13 +00:00
Tatsuhiro Tsujikawa c43e26c2a9 2009-05-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added test case for zero-length filter.
	* test/BitfieldManTest.cc
2009-05-12 15:19:27 +00:00
Tatsuhiro Tsujikawa 8bbbc9c33b 2009-05-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
DownloadResult now has the list of FileEntry.  The download
	summary displays the path of first selected file and the number of
	remaining files for multi-file torrent.
	* src/DownloadResult.h
	* src/RequestGroup.cc
	* src/RequestGroupMan.cc
	* test/RequestGroupTest.cc
2009-05-12 15:16:11 +00:00
Tatsuhiro Tsujikawa 62165b9ed1 2009-05-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Throw DlAbortEx instead of FatalException during parsing options
	because we don't want for aria2 to quit when bad option is passed
	via XML-RPC.
	* src/OptionHandlerException.cc
	* src/OptionHandlerException.h
	* src/OptionHandlerImpl.h
	* src/OptionParser.cc
	* src/OptionParser.h
	* src/PStringSegment.cc
	* src/ParameterizedStringParser.cc
	* src/download_helper.cc
	* test/ParameterizedStringParserTest.cc
2009-05-12 13:51:12 +00:00
Tatsuhiro Tsujikawa 2758562eb0 2009-05-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Selecting files are now done in
	DefaultBtContext::setFileFileter().
	PieceStorage::setFileFilter(), DiskAdaptor::addDownloadEntry()
	functions are removed because they are no longer used.  Creating
	filter in BitfieldMan is done in new funtion
	PieceStorage::setupFileFilter()	
	* src/BtContext.cc
	* src/BtContext.h
	* src/DefaultBtContext.cc
	* src/DefaultBtContext.h
	* src/DefaultPieceStorage.cc
	* src/DefaultPieceStorage.h
	* src/DiskAdaptor.cc
	* src/DiskAdaptor.h
	* src/PieceStorage.h
	* src/RequestGroup.cc
	* src/UnknownLengthPieceStorage.h
	* src/XmlRpcMethodImpl.cc
	* test/DefaultBtContextTest.cc
	* test/MockBtContext.h
	* test/MockPieceStorage.h
2009-05-12 13:31:04 +00:00
Tatsuhiro Tsujikawa 81b19074f8 2009-05-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Renamed addURI as addUri
	* src/XmlRpcMethodFactory.cc
	* src/XmlRpcMethodImpl.cc
	* src/XmlRpcMethodImpl.h	
	* test/XmlRpcMethodTest.cc
2009-05-10 14:51:20 +00:00
Tatsuhiro Tsujikawa 4e18c92371 2009-05-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Return fault structure for error. FailXmlRpcMethod is renamed as
	NoSuchMethodXmlRpcMethod. pieceLength and numPieces are returned
	in non-torrent download. Return single param value.
	* src/XmlRpcMethod.cc
	* src/XmlRpcMethodFactory.cc
	* src/XmlRpcMethodImpl.cc
	* src/XmlRpcMethodImpl.h
	* test/XmlRpcMethodTest.cc
2009-05-09 04:55:53 +00:00
Tatsuhiro Tsujikawa 7e7f809339 2009-05-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Set DownloadResult::IN_PROGRESS for downloads removed by xml-rpc
	command.
	* src/RequestGroup.cc
	* src/RequestGroup.h
	* src/RequestGroupMan.cc
	* src/XmlRpcMethodImpl.cc
	* test/RequestGroupTest.cc
2009-05-09 04:11:31 +00:00
Tatsuhiro Tsujikawa 4cb5468662 2009-05-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Now RequestGroup has its own copy of Option object. This will help
	to give custom option for each RequestGroup.
	addTorrentFile command now takes options.
	* src/AbstractCommand.cc
	* src/AbstractCommand.h
	* src/AbstractProxyRequestCommand.cc
	* src/ActivePeerConnectionCommand.cc
	* src/ActivePeerConnectionCommand.h
	* src/AdaptiveURISelector.cc
	* src/BtCheckIntegrityEntry.cc
	* src/BtDependency.cc
	* src/BtDependency.h
	* src/BtFileAllocationEntry.cc
	* src/BtPostDownloadHandler.cc
	* src/CheckIntegrityEntry.cc
	* src/DownloadCommand.cc
	* src/FtpDownloadCommand.cc
	* src/FtpFinishDownloadCommand.cc
	* src/FtpInitiateConnectionCommand.cc
	* src/FtpNegotiationCommand.cc
	* src/HttpInitiateConnectionCommand.cc
	* src/HttpRequestCommand.cc
	* src/HttpResponseCommand.cc
	* src/HttpSkipResponseCommand.cc
	* src/InitiateConnectionCommand.cc
	* src/InitiateConnectionCommandFactory.cc
	* src/InitiatorMSEHandshakeCommand.cc
	* src/InitiatorMSEHandshakeCommand.h
	* src/Metalink2RequestGroup.cc
	* src/Metalink2RequestGroup.h
	* src/MetalinkPostDownloadHandler.cc
	* src/MultiUrlRequestInfo.cc
	* src/MultiUrlRequestInfo.h
	* src/PeerAbstractCommand.cc
	* src/PeerInteractionCommand.cc
	* src/PeerInteractionCommand.h
	* src/PeerReceiveHandshakeCommand.cc
	* src/PeerReceiveHandshakeCommand.h
	* src/RequestGroup.cc
	* src/RequestGroup.h
	* src/TrackerWatcherCommand.cc
	* src/TrackerWatcherCommand.h
	* src/XmlRpcMethod.cc
	* src/XmlRpcMethod.h
	* src/XmlRpcMethodImpl.cc
	* src/download_helper.cc
	* src/download_helper.h
	* src/main.cc
	* test/BtDependencyTest.cc
	* test/BtPostDownloadHandlerTest.cc
	* test/DefaultBtMessageDispatcherTest.cc
	* test/DownloadHandlerFactoryTest.cc
	* test/DownloadHelperTest.cc
	* test/Metalink2RequestGroupTest.cc
	* test/MetalinkPostDownloadHandlerTest.cc
	* test/RequestGroupManTest.cc
	* test/RequestGroupTest.cc
2009-05-08 16:41:21 +00:00
Tatsuhiro Tsujikawa b57b75f98d 2009-05-08 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added xml-rpc functionality. Currently only addURI commad is
	supported. To enable xml-rpc, run aria2 with
	--enable-http-server. This option name is temporal and will be
	changed. The feature that reports download progress in html format
	is temporarily disabled.
	* src/HttpServer.cc
	* src/HttpServer.h
	* src/HttpServerBodyCommand.cc
	* src/HttpServerBodyCommand.h
	* src/HttpServerCommand.cc
	* src/HttpServerResponseCommand.cc
	* src/Makefile.am
	* src/OptionParser.cc
	* src/OptionParser.h
	* src/RequestGroupMan.cc
	* src/RequestGroupMan.h
	* src/XmlRpcMethod.cc
	* src/XmlRpcMethod.h
	* src/XmlRpcMethodFactory.cc
	* src/XmlRpcMethodFactory.h
	* src/XmlRpcMethodImpl.cc
	* src/XmlRpcMethodImpl.h
	* src/download_helper.cc
	* src/download_helper.h
	* test/Makefile.am
	* test/XmlRpcMethodTest.cc
2009-05-08 07:58:50 +00:00
Tatsuhiro Tsujikawa 3a81b3c3d7 2009-05-08 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added xml-rpc request parser. The supported value types are:
	i4/int, string, double, struct, array, base64.  Currently only
	libxml2 version is provided.
	* src/Xml2XmlRpcRequestProcessor.cc
	* src/Xml2XmlRpcRequestProcessor.h
	* src/XmlRpcElements.cc
	* src/XmlRpcElements.h
	* src/XmlRpcRequest.h
	* src/XmlRpcRequestParserController.cc
	* src/XmlRpcRequestParserController.h
	* src/XmlRpcRequestParserState.h
	* src/XmlRpcRequestParserStateImpl.cc
	* src/XmlRpcRequestParserStateImpl.h
	* src/XmlRpcRequestParserStateMachine.cc
	* src/XmlRpcRequestParserStateMachine.h
	* src/XmlRpcRequestProcessor.h
	* test/XmlRpcRequestParserControllerTest.cc
	* test/XmlRpcRequestProcessorTest.cc
2009-05-08 03:24:24 +00:00
Tatsuhiro Tsujikawa ce9c79a2f3 2009-05-07 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Pass reference of Option object instead of pointer.
	* src/download_helper.cc
	* src/download_helper.h
	* src/main.cc
	* test/DownloadHelperTest.cc
2009-05-07 08:52:38 +00:00
Tatsuhiro Tsujikawa 4da631bef6 2009-05-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Moved piece statistics stuff to new PieceStatMan class.
	Refactored PieceSelector interface.
	* src/DefaultPieceStorage.cc
	* src/DefaultPieceStorage.h
	* src/LongestSequencePieceSelector.cc
	* src/LongestSequencePieceSelector.h
	* src/Makefile.am
	* src/PieceSelector.h
	* src/PieceStatMan.cc
	* src/PieceStatMan.h
	* src/RarestPieceSelector.cc
	* src/RarestPieceSelector.h
	* src/RequestGroup.cc
	* test/DefaultPieceStorageTest.cc
	* test/InOrderPieceSelector.h
	* test/Makefile.am
	* test/PieceStatManTest.cc
	* test/RarestPieceSelectorTest.cc
2009-05-06 07:49:22 +00:00
Tatsuhiro Tsujikawa d05d8bbddc 2009-05-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added static member _protocolFamily to SocketCore.  By default,
	SocketCore uses AF_UNSPEC for getaddrinfo hints to resolve
	address. Sometime SocketCore::bind() and
	SocketCore::establishConnection() use difference protocl family
	and latter cannot connect to former. To avoid this situation, we
	limit protocol family to AF_INET for unit tests.
	* src/SocketCore.cc
	* src/SocketCore.h
	* test/AllTest.cc
2009-05-06 07:42:59 +00:00
Tatsuhiro Tsujikawa 3511aad188 2009-05-05 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Applied Pascal Bleser's patch: increases MAX_RECV_BUFFER for ftp
	from 4096 to 65536 (for insanely large ftp login banners)
	* src/FtpConnection.h
	* test/FtpConnectionTest.cc
2009-05-05 03:27:45 +00:00
Tatsuhiro Tsujikawa 8fe80169b3 2009-05-05 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
In DefaultBtContext::getActualBasePath(), return first
	FileEntry::getPath() for single file torrent.	
	* src/DefaultBtContext.cc
	* test/DefaultBtContextTest.cc
2009-05-05 03:20:56 +00:00
Tatsuhiro Tsujikawa c1aef8e2d1 2009-05-04 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Now the constructor of AbstractDiskWriter takes filename as an
	argument and filename argument is removed from openFile(),
	initAndOpenFile(), openExistingFile() interface.  storeDir
	member and its accessor functions are removed from DiskAdaptor
	because it is not used anymore.  size() member function of
	DefaultDiskWriter, DirectDiskAdaptor and MultiDiskAdaptor now
	can be called without opening file.
	* src/AbstractDiskWriter.cc
	* src/AbstractDiskWriter.h
	* src/AbstractSingleDiskAdaptor.cc
	* src/AbstractSingleDiskAdaptor.h
	* src/ByteArrayDiskWriter.cc
	* src/ByteArrayDiskWriter.h
	* src/ByteArrayDiskWriterFactory.cc
	* src/ByteArrayDiskWriterFactory.h
	* src/DefaultDiskWriter.cc
	* src/DefaultDiskWriter.h
	* src/DefaultDiskWriterFactory.cc
	* src/DefaultDiskWriterFactory.h
	* src/DefaultPieceStorage.cc
	* src/DirectDiskAdaptor.cc
	* src/DirectDiskAdaptor.h
	* src/DiskAdaptor.h
	* src/DiskWriter.h
	* src/DiskWriterFactory.h
	* src/MessageDigestHelper.cc
	* src/MultiDiskAdaptor.cc
	* src/RequestGroup.cc
	* src/UnknownLengthPieceStorage.cc
	* src/Util.cc
	* test/DefaultDiskWriterTest.cc
	* test/DirectDiskAdaptorTest.cc
	* test/FallocFileAllocationIteratorTest.cc
	* test/MessageDigestHelperTest.cc
	* test/MetalinkProcessorTest.cc
	* test/MultiDiskAdaptorTest.cc
	* test/MultiFileAllocationIteratorTest.cc
	* test/SingleFileAllocationIteratorTest.cc
	* test/UtilTest.cc
2009-05-04 07:50:38 +00:00
Tatsuhiro Tsujikawa 717fa2a855 2009-05-03 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Code cleanup
	* test/MockPieceStorage.cc
2009-05-03 11:01:52 +00:00
Tatsuhiro Tsujikawa ee229c6f00 2009-05-03 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that with --check-integrity option aria2 reports
	downloaded file size is 0 even if some parts of file is
	correctly downloaded.  This bug is reproducible for the download
	that a file includes last piece is missing. This bug doesn't
	reveal for single-torrent with file allocation on.
	* src/IteratableChecksumValidator.cc
	* test/IteratableChecksumValidatorTest.cc
2009-05-03 06:26:44 +00:00
Tatsuhiro Tsujikawa 16f5ebcfcd 2009-04-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed MetalinkProcessorFactory. Since we don't use both
	libxml2 and expat simultaneously, MetalinkProcessor is now not
	base class and it is directly implemented in
	XML2SAXMetalinkProcessor and ExpatMetalinkProcessor.	
	* src/ExpatMetalinkProcessor.cc
	* src/ExpatMetalinkProcessor.h
	* src/Makefile.am
	* src/MetalinkHelper.cc
	* src/MetalinkProcessor.h
	* src/MetalinkProcessorFactory.cc: Removed.
	* src/MetalinkProcessorFactory.h: Removed
	* src/XML2SAXMetalinkProcessor.cc
	* src/XML2SAXMetalinkProcessor.h
	* test/MetalinkProcessorTest.cc
2009-04-28 09:22:43 +00:00
Tatsuhiro Tsujikawa d229909bf8 2009-04-27 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added missing file.
	* test/Makefile.am
	* test/url-list-singleFileEndsWithSlash.torrent
2009-04-27 12:00:41 +00:00
Tatsuhiro Tsujikawa 49b4cfbfcd 2009-04-27 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Put BDE in aria2 namespace. BDE will also be used to store
	xml-rpc request.
	* src/AnnounceList.cc
	* src/AnnounceList.h
	* src/BDE.cc: Added
	* src/BDE.h: Added
	* src/DHTAbstractMessage.cc
	* src/DHTAbstractMessage.h
	* src/DHTAnnouncePeerMessage.cc
	* src/DHTAnnouncePeerMessage.h
	* src/DHTAnnouncePeerReplyMessage.cc
	* src/DHTAnnouncePeerReplyMessage.h
	* src/DHTFindNodeMessage.cc
	* src/DHTFindNodeMessage.h
	* src/DHTFindNodeReplyMessage.cc
	* src/DHTFindNodeReplyMessage.h
	* src/DHTGetPeersMessage.cc
	* src/DHTGetPeersMessage.h
	* src/DHTGetPeersReplyMessage.cc
	* src/DHTGetPeersReplyMessage.h
	* src/DHTMessageFactory.h
	* src/DHTMessageFactoryImpl.cc
	* src/DHTMessageFactoryImpl.h
	* src/DHTMessageReceiver.cc
	* src/DHTMessageTracker.cc
	* src/DHTMessageTracker.h
	* src/DHTPingMessage.cc
	* src/DHTPingMessage.h
	* src/DHTPingReplyMessage.cc
	* src/DHTPingReplyMessage.h
	* src/DHTQueryMessage.cc
	* src/DHTQueryMessage.h
	* src/DHTResponseMessage.cc
	* src/DHTResponseMessage.h
	* src/DefaultBtAnnounce.cc
	* src/DefaultBtContext.cc
	* src/DefaultBtContext.h
	* src/HandshakeExtensionMessage.cc
	* src/Makefile.am
	* src/PeerListProcessor.h
	* src/UTPexExtensionMessage.cc
	* src/bencode.cc
	* src/bencode.h
	* test/AnnounceListTest.cc
	* test/BDETest.cc: Added
	* test/BencodeTest.cc
	* test/DHTAnnouncePeerMessageTest.cc
	* test/DHTAnnouncePeerReplyMessageTest.cc
	* test/DHTFindNodeMessageTest.cc
	* test/DHTFindNodeReplyMessageTest.cc
	* test/DHTGetPeersMessageTest.cc
	* test/DHTGetPeersReplyMessageTest.cc
	* test/DHTMessageFactoryImplTest.cc
	* test/DHTMessageTrackerTest.cc
	* test/DHTPingMessageTest.cc
	* test/DHTPingReplyMessageTest.cc
	* test/Makefile.am
	* test/MockDHTMessageFactory.h
	* test/PeerListProcessorTest.cc
2009-04-27 11:45:22 +00:00
Tatsuhiro Tsujikawa d58742ad21 2009-04-27 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use url-list (web-seeding) only for single-file torrent.  This
	is basically the same behavior with Metalink file with torrent
	and URIs.
	* src/RequestGroup.cc
	* src/DefaultBtContext.cc
	* test/DefaultBtContextTest.cc
2009-04-27 06:55:10 +00:00
Tatsuhiro Tsujikawa 1ea7fca02b 2009-04-26 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Rewritten expr
	* src/array_fun.h
	* test/array_funTest.cc
2009-04-25 17:04:32 +00:00
Tatsuhiro Tsujikawa e385c68f52 2009-04-25 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed ExtendedMessagingAware. Instead of using inheritance,
	added ExtensionMessageRegistry and it is passed to
	DefaultExtensionMessageFactory.
	* src/DefaultBtInteractive.cc
	* src/DefaultBtInteractive.h
	* src/DefaultExtensionMessageFactory.cc
	* src/DefaultExtensionMessageFactory.h
	* src/ExtendedMessagingAware.h: Removed.
	* src/ExtensionMessageFactory.h
	* src/ExtensionMessageRegistry.h: Added.
	* src/Makefile.am
	* src/PeerInteractionCommand.cc
	* test/DefaultExtensionMessageFactoryTest.cc
2009-04-25 10:48:00 +00:00
Tatsuhiro Tsujikawa 35763a2ae0 2009-04-25 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that prevents torrent download from finishing.
	The bug doesn't reveal for all torrents. The torrents affected
	this bug satisfies ((N+7)/8)%4 == 0 and N%32 != 0 where N is the
	number of pieces.	
	* src/bitfield.h
	* test/bitfieldTest.cc
2009-04-25 10:30:25 +00:00
Tatsuhiro Tsujikawa 6703097652 2009-04-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Rewritten PeerListProcessor
	* src/PeerListProcessor.h
	* src/CompactPeerListProcessor.h: Removed
	* src/CompactPeerListProcessor.cc: Removed
	* src/DelegatingPeerListProcessor.cc: Removed.
	* src/DefaultBtAnnounce.cc
	* src/Makefile.am
	* src/UTPexExtensionMessage.cc
	* src/DefaultPeerListProcessor.h: Removed.
	* src/DefaultPeerListProcessor.cc: Removed.
	* src/DelegatingPeerListProcessor.h: Removed.
	* test/Makefile.am
	* test/PeerListProcessorTest.cc
	* test/DefaultPeerListProcessorTest.cc: Removed.
2009-04-23 13:39:53 +00:00
Tatsuhiro Tsujikawa afdd61f9d1 2009-04-21 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Rewritten event dispatch in BtMessage. Removed BtEventListener,
	BtEvent.	
	* src/AbstractBtEventListener.h: Removed.
	* src/AbstractBtMessage.cc
	* src/AbstractBtMessage.h
	* src/BtAbortOutstandingRequestEvent.h
	* src/BtCancelSendingPieceEvent.h
	* src/BtChokedEvent.h: Removed.
	* src/BtChokingEvent.h
	* src/BtEvent.h: Removed
	* src/BtEventListener.h: Removed.
	* src/BtMessage.h
	* src/BtPieceMessage.cc
	* src/BtPieceMessage.h
	* src/BtRequestMessage.cc
	* src/BtRequestMessage.h
	* src/DefaultBtMessageDispatcher.cc
	* src/Makefile.am
	* src/a2functional.h
	* test/BtPieceMessageTest.cc
	* test/BtRequestMessageTest.cc
	* test/DefaultBtMessageDispatcherTest.cc
	* test/MockBtMessage.h
2009-04-21 14:52:04 +00:00
Tatsuhiro Tsujikawa 65a358c68b 2009-04-17 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed segmentation fault when GZipDecoder::decode() returns 0
	byte.
	* src/DownloadCommand.cc
	* src/bitfield.h
	* test/bitfieldTest.cc

	Fixed the bug that causes infinite loop if broken web server
	returns chunked response without last "0" chunk-size marker and
	closes connection.
	* src/DownloadCommand.cc

	Instantiate properly configured HttpDownloadCommand for
	non-resumable downlaods.
	* src/HttpResponseCommand.cc
2009-04-17 13:19:17 +00:00
Tatsuhiro Tsujikawa d2d4f67bbe 2009-04-16 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Rewritten array operation functions.
	* src/BitfieldMan.cc
	* src/array_fun.h
	* test/array_funTest.cc
2009-04-16 13:43:23 +00:00
Tatsuhiro Tsujikawa 0e70ba46a9 2009-04-13 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Increase prefixLength for the bucket which doesn't own local
	node ID when splitting bucket.
	* src/DHTBucket.cc
	* test/DHTBucketTest.cc
2009-04-13 12:47:50 +00:00
Tatsuhiro Tsujikawa becd34bcb9 2009-04-05 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that removed peer's session upload/download length
	are counted twice in _cachedTransferStat before it is
	re-calculated.  This affected the calculation of shara ratio,
	resulting aria2 wrongly determines that specified share ratio is
	reached. Also fixed the typo in calculateStatFor function name.
	* src/BtSetup.cc
	* src/DefaultPeerStorage.cc
	* src/ShareRatioSeedCriteria.h
	* test/ShareRatioSeedCriteriaTest.cc
2009-04-05 10:38:15 +00:00
Tatsuhiro Tsujikawa 5541477dce 2009-04-01 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Rewritten isInRange()
	* src/DHTBucket.cc
	* test/DHTBucketTest.cc
2009-04-01 12:28:39 +00:00
Tatsuhiro Tsujikawa a6b02840fa 2009-03-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
BitfieldMan::getMissingIndexes family functions now takes
	unsigned char* bitfield instead of stl container for efficiency.
	PieceSelector::select now takes this
	bitfield. RarestPieceSelector::select now also performs
	efficiently for this change.  bitfield namespace is introduced
	and it has several helper functions to handle basic bitfield
	operations such as test, count set bits, etc.
	* src/BitfieldMan.cc
	* src/BitfieldMan.h
	* src/DefaultBtRequestFactory.cc
	* src/DefaultPieceStorage.cc
	* src/DefaultPieceStorage.h
	* src/LongestSequencePieceSelector.cc
	* src/LongestSequencePieceSelector.h
	* src/Makefile.am
	* src/Piece.cc
	* src/Piece.h
	* src/PieceSelector.h
	* src/RarestPieceSelector.cc
	* src/RarestPieceSelector.h
	* src/Util.cc
	* src/Util.h
	* src/bitfield.h
	* test/BitfieldManTest.cc
	* test/LongestSequencePieceSelectorTest.cc
	* test/Makefile.am
	* test/RarestPieceSelectorTest.cc
	* test/UtilTest.cc
	* test/bitfieldTest.cc
2009-03-28 13:29:38 +00:00
Tatsuhiro Tsujikawa 29c5ef9215 2009-03-25 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added 'falloc' parameter for --file-allocation option.  'falloc'
	allocation mode uses posix_fallocate() system call to allocate
	file on disk.  If you are using newer file systems such as ext4
        (with extents support), btrfs or xfs, 'falloc' is your best
	choice. It allocates large(few GiB) files almost instantly.
	Don't use 'falloc' with legacy file systems such as ext3 because
	it takes almost same time as 'prealloc' and it blocks aria2
	entirely until allocation finishes. 'falloc' may not be
	available if your system doesn't have posix_fallocate() system
	call.
	* configure.ac
	* src/AbstractDiskWriter.cc
	* src/AbstractDiskWriter.h
	* src/AbstractSingleDiskAdaptor.cc
	* src/BinaryStream.h
	* src/BtCheckIntegrityEntry.cc
	* src/ByteArrayDiskWriter.h
	* src/CheckIntegrityEntry.cc
	* src/CheckIntegrityEntry.h
	* src/DefaultPieceStorage.cc
	* src/DiskAdaptor.cc
	* src/DiskAdaptor.h
	* src/DiskWriter.h
	* src/FallocFileAllocationIterator.cc
	* src/FallocFileAllocationIterator.h
	* src/FileAllocationEntry.cc
	* src/FileAllocationEntry.h
	* src/Makefile.am
	* src/MultiFileAllocationIterator.cc
	* src/MultiFileAllocationIterator.h
	* src/OptionHandlerFactory.cc
	* src/RequestGroup.cc
	* src/StreamCheckIntegrityEntry.cc
	* src/prefs.cc
	* src/prefs.h
	* src/usage_text.h
	* test/FallocFileAllocationIteratorTest.cc
	* test/Makefile.am
2009-03-25 05:43:07 +00:00
Tatsuhiro Tsujikawa 289ae1b635 2009-03-25 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Replaced std::vector<SharedHandle<PieceStats> _sortedPieceStats
	with std::vector<size_t> _sortedPieceStatIndexes to reduce the
	cost of std::rotate().
	* src/RarestPieceSelector.cc
	* src/RarestPieceSelector.h
	* test/RarestPieceSelectorTest.cc
2009-03-24 15:24:30 +00:00
Tatsuhiro Tsujikawa 662a90ce9b 2009-03-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Refactored RarestPieceSelector to reduce CPU load, especially
	for addPieceStats.	
	* src/RarestPieceSelector.cc
	* src/RarestPieceSelector.h
2009-03-20 13:37:53 +00:00
Tatsuhiro Tsujikawa e3ed6adf91 2009-03-19 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Reduced the number of calls to PeerStorage::calculateStat() and
	SegmentMan::calculateDownloadSpeed() to lower CPU usage on
	higher transfer rate.	
	* src/DefaultBtInteractive.cc
	* src/DefaultBtMessageDispatcher.cc
	* src/DefaultPeerStorage.cc
	* src/DefaultPeerStorage.h
	* src/DownloadCommand.cc
	* src/DownloadEngine.cc
	* src/PeerStorage.h
	* src/SegmentMan.cc
	* src/SegmentMan.h
	* test/MockPeerStorage.h
2009-03-19 13:42:10 +00:00
Tatsuhiro Tsujikawa 75a525b031 2009-03-13 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Prepended _dir+"/" after joining path elements in torrent file.
	* src/DefaultBtContext.cc
	* test/DefaultBtContextTest.cc
2009-03-13 16:10:28 +00:00
Tatsuhiro Tsujikawa c211a2aa4c 2009-03-13 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Slice/joinPath for name of single torrent.
	* src/DefaultBtContext.cc
	* test/DefaultBtContextTest.cc
2009-03-13 13:42:19 +00:00
Tatsuhiro Tsujikawa 87f4fda22f 2009-03-13 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Renamed ServerStatURISelector as FeedbackURISelector.
	* src/FeedbackURISelector.cc
	* src/FeedbackURISelector.h
	* src/Makefile.am
	* src/RequestGroupMan.cc
	* src/ServerStatURISelector.cc
	* src/ServerStatURISelector.h
	* test/FeedbackURISelectorTest.cc
	* test/Makefile.am
	* test/ServerStatURISelectorTest.cc
2009-03-13 12:44:58 +00:00
Tatsuhiro Tsujikawa 15582ed8cd 2009-03-13 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Refactored BtMessage subclasses. BtCancelMessage,
	BtRequestMessage and BtRejectMessage are derived from
	RangeBtMessage class.
	BtAllowedFastMessage, BtHaveMessage and BtSuggestPieceMessage
	are derived from IndexBtMessage class. BtChokeMessage,
	BtHaveAllMessage, BtHaveNoneMessage, BtInterestedMessage,
	BtNotInterestedMessage and BtUnchokeMessage are derived from
	ZeroBtMessage class.
	* src/AbstractBtMessage.cc
	* src/AbstractBtMessage.h
	* src/BtAllowedFastMessage.cc
	* src/BtAllowedFastMessage.h
	* src/BtAllowedFastMessageValidator.h: Removed
	* src/BtBitfieldMessage.cc
	* src/BtBitfieldMessage.h
	* src/BtCancelMessage.cc
	* src/BtCancelMessage.h
	* src/BtCancelMessageValidator.h: Removed
	* src/BtChokeMessage.cc
	* src/BtChokeMessage.h
	* src/BtExtendedMessage.cc
	* src/BtExtendedMessage.h
	* src/BtHandshakeMessage.cc
	* src/BtHandshakeMessage.h
	* src/BtHaveAllMessage.cc
	* src/BtHaveAllMessage.h
	* src/BtHaveMessage.cc
	* src/BtHaveMessage.h
	* src/BtHaveMessageValidator.h: Removed
	* src/BtHaveNoneMessage.cc
	* src/BtHaveNoneMessage.h
	* src/BtInterestedMessage.cc
	* src/BtInterestedMessage.h
	* src/BtKeepAliveMessage.cc
	* src/BtKeepAliveMessage.h
	* src/BtNotInterestedMessage.cc
	* src/BtNotInterestedMessage.h
	* src/BtPieceMessage.cc
	* src/BtPieceMessage.h
	* src/BtPortMessage.cc
	* src/BtPortMessage.h
	* src/BtRejectMessage.cc
	* src/BtRejectMessage.h
	* src/BtRejectMessageValidator.h: Removed
	* src/BtRequestMessage.cc
	* src/BtRequestMessage.h
	* src/BtRequestMessageValidator.h: Removed
	* src/BtSuggestPieceMessage.cc
	* src/BtSuggestPieceMessage.h
	* src/BtSuggestPieceMessageValidator.h: Removed
	* src/BtUnchokeMessage.cc
	* src/BtUnchokeMessage.h
	* src/DefaultBtMessageFactory.cc
	* src/IndexBtMessage.cc
	* src/IndexBtMessage.h
	* src/IndexBtMessageValidator.h
	* src/Makefile.am
	* src/PeerMessageUtil.cc
	* src/PeerMessageUtil.h
	* src/RangeBtMessage.cc
	* src/RangeBtMessage.h
	* src/RangeBtMessageValidator.h
	* src/SimpleBtMessage.cc
	* src/SimpleBtMessage.h
	* src/ZeroBtMessage.cc
	* src/ZeroBtMessage.h
	* test/BtRequestMessageTest.cc
2009-03-12 15:54:43 +00:00
Tatsuhiro Tsujikawa 4e0c03500c 2009-03-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
BtMessage now holds _id attribute.  MESSAGE_LENGTH that is
	declared as non-const previously is now const and defined in
	class definition.
	* src/AbstractBtMessage.cc
	* src/AbstractBtMessage.h
	* src/BtAllowedFastMessage.cc
	* src/BtAllowedFastMessage.h
	* src/BtBitfieldMessage.h
	* src/BtCancelMessage.cc
	* src/BtCancelMessage.h
	* src/BtChokeMessage.cc
	* src/BtChokeMessage.h
	* src/BtExtendedMessage.cc
	* src/BtExtendedMessage.h
	* src/BtHandshakeMessage.cc
	* src/BtHandshakeMessage.h
	* src/BtHaveAllMessage.cc
	* src/BtHaveAllMessage.h
	* src/BtHaveMessage.cc
	* src/BtHaveMessage.h
	* src/BtHaveNoneMessage.cc
	* src/BtHaveNoneMessage.h
	* src/BtInterestedMessage.cc
	* src/BtInterestedMessage.h
	* src/BtKeepAliveMessage.cc
	* src/BtKeepAliveMessage.h
	* src/BtMessage.h
	* src/BtNotInterestedMessage.cc
	* src/BtNotInterestedMessage.h
	* src/BtPieceMessage.h
	* src/BtPortMessage.cc
	* src/BtPortMessage.h
	* src/BtRejectMessage.cc
	* src/BtRejectMessage.h
	* src/BtRequestMessage.cc
	* src/BtRequestMessage.h
	* src/BtSuggestPieceMessage.cc
	* src/BtSuggestPieceMessage.h
	* src/BtUnchokeMessage.cc
	* src/BtUnchokeMessage.h
	* src/SimpleBtMessage.cc
	* src/SimpleBtMessage.h
	* test/MockBtMessage.h
2009-03-11 15:44:04 +00:00
Tatsuhiro Tsujikawa 176c9d2002 2009-03-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed --direct-file-mapping option and CopyDiskAdaptor.
	* src/CopyDiskAdaptor.cc: Removed
	* src/CopyDiskAdaptor.h: Removed
	* src/DefaultPieceStorage.cc
	* src/Makefile.am
	* src/OptionHandlerFactory.cc
	* src/prefs.cc
	* src/prefs.h
	* src/usage_text.h
	* test/CopyDiskAdaptorTest.cc: Removed
	* test/Makefile.am
2009-03-10 13:08:07 +00:00
Tatsuhiro Tsujikawa 849a533d61 2009-03-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed getName() from DownloadContext. getName() is declared in
	BtContext.
	* src/BtContext.h
	* src/DownloadContext.h
	* src/SingleFileDownloadContext.cc
	* src/SingleFileDownloadContext.h
		
	Removed getFilePath() from DiskAdaptor. getFilePath() is
	declared in AbstractSingleDiskAdaptor.
	* src/AbstractSingleDiskAdaptor.h
	* src/DiskAdaptor.h
	* src/MultiDiskAdaptor.h
	* src/RequestGroup.cc
	
	Removed setTopDir() and getTopDir() and getTopDirPath() from
	MultiDiskAdaptor.
	* src/DefaultPieceStorage.cc
	* src/MultiDiskAdaptor.cc
	* src/MultiDiskAdaptor.h
	* test/MultiDiskAdaptorTest.cc
2009-03-10 12:24:29 +00:00
Tatsuhiro Tsujikawa e2704bd823 2009-03-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
FileEntry::getPath() contains store(top level) directory to
	simplify path handling operation.  In the previous
	implementation, store directory is concatenated to
	FileEntry::getPath() in DownloadContext.
	* src/BtDependency.cc
	* src/BtPostDownloadHandler.cc
	* src/CopyDiskAdaptor.cc
	* src/DefaultBtContext.cc
	* src/DirectDiskAdaptor.cc
	* src/FileEntry.cc
	* src/FileEntry.h
	* src/FtpNegotiationCommand.cc
	* src/HttpResponse.cc
	* src/HttpResponseCommand.cc
	* src/Metalink2RequestGroup.cc
	* src/MultiDiskAdaptor.cc
	* src/MultiDiskAdaptor.h
	* src/MultiFileAllocationIterator.cc
	* src/RequestGroup.cc
	* src/SingleFileDownloadContext.cc
	* src/SingleFileDownloadContext.h
	* src/download_helper.cc
	* test/BtDependencyTest.cc
	* test/CopyDiskAdaptorTest.cc
	* test/DefaultBtContextTest.cc
	* test/DefaultBtProgressInfoFileTest.cc
	* test/DirectDiskAdaptorTest.cc
	* test/DownloadHelperTest.cc
	* test/FileEntryTest.cc
	* test/MultiDiskAdaptorTest.cc
	* test/MultiFileAllocationIteratorTest.cc
	* test/RequestGroupTest.cc
	* test/SingleFileDownloadContextTest.cc
2009-03-09 15:10:26 +00:00
Tatsuhiro Tsujikawa c63ceff5dd 2009-03-08 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed compiler waring
	* test/UriListParserTest.cc
2009-03-08 10:17:34 +00:00
Tatsuhiro Tsujikawa f44554a634 2009-03-07 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added --index-out option to specify each file path for torrent.
	Here index shown in --show-files option is used to specify which
	file path should be altered. For example, to change the file
	path with index=2, use --index-out=2=aria2.tar.bz2. You can use
	this option multiple times: --index-out=1=aria2.tar.bz2
	--index-out=2=aria2-opt.tar.bz2. The short hand form -O is also
	available. This option can be specified in -i list.	
	* src/DefaultBtContext.cc
	* src/DefaultBtContext.h
	* src/MultiDiskAdaptor.cc
	* src/MultiDiskAdaptor.h
	* src/MultiFileAllocationIterator.cc
	* src/OptionHandlerFactory.cc
	* src/OptionHandlerImpl.h
	* src/Util.cc
	* src/Util.h
	* src/download_helper.cc
	* src/prefs.cc
	* src/prefs.h
	* src/usage_text.h
	* test/DefaultBtContextTest.cc
	* test/MultiDiskAdaptorTest.cc
	* test/MultiFileAllocationIteratorTest.cc
	* test/UtilTest.cc
2009-03-07 03:10:53 +00:00
Tatsuhiro Tsujikawa 4aae48c9b2 2009-03-05 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use Util::pathJoin()
	* src/MetalinkParserController.cc
	* test/test.xml
2009-03-04 15:56:56 +00:00
Tatsuhiro Tsujikawa 70a8403575 2009-03-05 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added Util::pathJoin()
	* src/Util.h
	* test/UtilTest.cc
2009-03-04 15:53:56 +00:00
Tatsuhiro Tsujikawa 6f0bd778ee 2009-03-04 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Applied basename function to remove directory element in
	content-disposition value.
	Return empty string if content-disposition value is ".." or ".".
	* src/Util.cc
	* test/UtilTest.cc
2009-03-04 14:49:10 +00:00
Tatsuhiro Tsujikawa 0b29a6e2cf 2009-02-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added --max-overall-download-limit option.  Now
	--max-upload-limit option is not ignored when
	--max-overall-upload-limit option has non-zero value. aria2
	checks download(upload) speed in the order:
	first checks overall speed limit and if it is not exceeded, then
	checks speed limit per download.  Thus you can specify both
	value. For example, set --max-overall-download-limit=1M and
	--max-download-limit=500K to prevent from one download from
	eating all overall speed limit.
	* src/DefaultBtInteractive.cc
	* src/DefaultBtInteractive.h
	* src/DefaultBtMessageDispatcher.cc
	* src/DefaultBtMessageDispatcher.h
	* src/DownloadCommand.cc
	* src/DownloadCommand.h
	* src/FtpNegotiationCommand.cc
	* src/HttpResponseCommand.cc
	* src/OptionHandlerFactory.cc
	* src/PeerInteractionCommand.cc
	* src/RequestGroup.cc
	* src/RequestGroup.h
	* src/RequestGroupMan.cc
	* src/RequestGroupMan.h
	* src/prefs.cc
	* src/prefs.h
	* src/usage_text.h
	* test/DefaultBtMessageDispatcherTest.cc
2009-02-28 11:48:26 +00:00
Tatsuhiro Tsujikawa 1c15b5373c 2009-02-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that disk writer is not created even if it shares
	same piece with the preceding file if the length of previous
	file is 0.
	* src/MultiDiskAdaptor.cc
	* test/MultiDiskAdaptorTest.cc
2009-02-27 15:33:07 +00:00
Tatsuhiro Tsujikawa 120e2de096 2009-02-19 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added --http-auth-challenge option.  If it is set to true(by
	default), aria2 sends HTTP authorization header only when it is
	requested by the server. If false is set, then authorization
	header is always sent to the server. This is useful for servers
	that don't respond 401 code when authentication is required.
	There is an exception: if username and password are embedded in
	URI, authorization header is always sent to the server
	regardless of this option.
	* src/AuthConfigFactory.cc
	* src/HttpSkipResponseCommand.cc
	* src/OptionHandlerFactory.cc
	* src/prefs.cc
	* src/prefs.h
	* src/usage_text.h
	* test/AuthConfigFactoryTest.cc
	* test/HttpRequestTest.cc
2009-02-19 12:02:22 +00:00
Tatsuhiro Tsujikawa eafb1bc615 2009-02-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed function throw list.
	* src/bencode.cc
	* src/bencode.h
	* test/BencodeTest.cc
2009-02-15 11:20:21 +00:00
Tatsuhiro Tsujikawa 34d7cd7a70 2009-02-13 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Open file in binary mode.
	* src/CookieStorage.cc
	* src/DHTSetup.cc
	* src/DHTUtil.cc
	* src/Netrc.cc
	* src/NsCookieParser.cc
	* src/ProtocolDetector.cc
	* src/RequestGroupMan.cc
	* src/Signature.cc
	* src/bencode.cc
	* src/download_helper.cc
	* src/option_processing.cc
	* test/CookieParserTest.cc
	* test/DefaultBtProgressInfoFileTest.cc
	* test/FileTest.cc
	* test/GZipDecoderTest.cc
	* test/RequestGroupManTest.cc
	* test/SignatureTest.cc
	* test/SingleFileAllocationIteratorTest.cc
	* test/UriListParserTest.cc
2009-02-13 11:28:42 +00:00
Tatsuhiro Tsujikawa 9ce0e78780 2009-02-13 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added missing call to arrayWrapperConst
	* test/array_funTest.cc
2009-02-12 15:39:07 +00:00
Tatsuhiro Tsujikawa b8b6b5c568 2009-02-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added array_wrapper template.
	* src/array_fun.h
	* test/array_funTest.cc
2009-02-12 13:44:34 +00:00
Tatsuhiro Tsujikawa 2e9edd316a 2009-02-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use localhost instead of 127.0.0.1
	* test/FtpConnectionTest.cc
	* test/MSEHandshakeTest.cc
2009-02-12 13:11:51 +00:00
Tatsuhiro Tsujikawa 1c46a26ae6 2009-02-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added operator T*
	* src/array_fun.h
	* test/array_funTest.cc
2009-02-12 13:10:38 +00:00
Tatsuhiro Tsujikawa c7cf936956 2009-02-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added LL for long long int constant.
	* test/FtpConnectionTest.cc
2009-02-11 16:08:14 +00:00
Tatsuhiro Tsujikawa 0a5f6751d1 2009-02-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added test for FtpConnection::receiveSizeResponse().
	* test/FtpConnectionTest.cc
2009-02-11 10:41:56 +00:00
Tatsuhiro Tsujikawa 0fc900c0ac 2009-02-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that adding 0 length filter to BitfieldMan filters
	1 block. It should not filter anything.
	* src/BitfieldMan.cc
	* src/ConsoleStatCalc.cc
	* test/BitfieldManTest.cc
2009-02-11 07:54:03 +00:00
Tatsuhiro Tsujikawa b5af788a00 2009-02-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed broken selected file BitTorrent download.
	* src/MultiDiskWriter.cc
	* test/MultiDiskWriterTest.cc
	* test/MultiFileAllocationIteratorTest.cc
2009-02-11 07:41:15 +00:00
Tatsuhiro Tsujikawa d63308afc5 2009-02-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Wait 2 seconds. 1 second is sometimes not enough.
	* test/TimeSeedCriteriaTest.cc
2009-02-10 14:53:32 +00:00
Tatsuhiro Tsujikawa 900d102bbf 2009-02-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use localhost instead of 127.0.0.1.
	* test/DHTConnectionImplTest.cc
2009-02-10 14:52:20 +00:00
Tatsuhiro Tsujikawa fe267b43d5 2009-02-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Don't use Time::parse(buf, "%Y%m%d%H%M%S") because Mac OS X and
	included strptime doesn't parse data for this format.
	* src/FtpConnection.cc
	* test/FtpConnectionTest.cc
2009-02-10 14:47:07 +00:00
Tatsuhiro Tsujikawa a57e0b1273 2009-02-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed tests giving -1 for unsigned argument.
	* test/SingleFileDownloadContextTest.cc
2009-02-10 14:45:21 +00:00
Tatsuhiro Tsujikawa 52b17520de 2009-02-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Don't use sha256 in tests because it might not be supported by
	the SSL library.
	* test/MetalinkProcessorTest.cc
2009-02-10 14:44:33 +00:00
Tatsuhiro Tsujikawa ab06444ba7 2009-02-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed tests giving -1 for unsigned argument.
	* test/AlphaNumberDecoratorTest
	* test/BitfieldManTest.cc
	* test/DefaultBtContextTest.cc
2009-02-10 14:42:49 +00:00
Tatsuhiro Tsujikawa abae62908f 2009-02-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Included fstream instead of iostream.
	* test/SignatureTest.cc
2009-02-09 12:45:07 +00:00
Tatsuhiro Tsujikawa 28d9af6d04 2009-02-08 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed #include <algorithm>
	* test/RequestGroupTest.cc
2009-02-08 14:21:20 +00:00
Tatsuhiro Tsujikawa 9bb57720cf 2009-02-08 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Rewritten AdaptiveURISelector::mayRetryWithIncreasedTimeout()
	using RequestGroup::extractURIResult().
	* src/AdaptiveURISelector.cc
	* src/RequestGroup.cc
	* src/RequestGroup.h
	* test/RequestGroupTest.cc
2009-02-08 14:17:55 +00:00
Tatsuhiro Tsujikawa b8d177dd5d 2009-02-08 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added tests for array_ptr.
	* test/array_funTest.cc
2009-02-08 11:27:22 +00:00
Tatsuhiro Tsujikawa 2881dbe025 2009-02-07 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added OptionParser::parseArg() which internally uses getopt_long
	to parse command-line options. All command-line options are now
	configured by OptionHandler. No manual editing of struct option*
	is required any more.
	* src/NameMatchOptionHandler.h
	* src/OptionHandler.h
	* src/OptionHandlerFactory.cc
	* src/OptionHandlerImpl.h
	* src/OptionParser.cc
	* src/OptionParser.h
	* src/array_fun.h
	* src/main.cc
	* src/option_processing.cc
	* test/OptionHandlerTest.cc
	* test/OptionParserTest.cc
2009-02-07 11:00:34 +00:00
Tatsuhiro Tsujikawa 5f0f8e68b2 2009-02-07 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed compile error when HAVE_EPOLL is not defined.
	Fixed linker error on bigendian systems.
	* src/SocketCore.cc
	* src/SocketCore.h
	* test/DefaultBtProgressInfoFileTest.cc
2009-02-06 16:49:24 +00:00
Tatsuhiro Tsujikawa 0640ea6254 2009-02-04 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added --bt-external-ip option. You can specify the external IP
	address to report to a BitTorrent tracker. Although this
	function is named 'external', it can accept any kind of IP
	addresses.
	* src/DefaultBtAnnounce.cc
	* src/OptionHandlerFactory.cc
	* src/option_processing.cc
	* src/prefs.cc
	* src/prefs.h
	* src/usage_text.h
	* test/DefaultBtAnnounceTest.cc
2009-02-04 14:11:30 +00:00
Tatsuhiro Tsujikawa 23a6eff88e 2009-02-03 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Extracted the algorithm to find the longest incremental sequence
	as max_sequence template.
	* src/LongestSequencePieceSelector.cc
	* src/a2algo.h
	* test/Makefile.am
	* test/a2algoTest.cc
2009-02-03 14:46:33 +00:00
Tatsuhiro Tsujikawa 388b64df04 2009-02-01 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
BtContext::getAnnounceTiers() now returns const reference.
	* src/BtContext.h
	* src/DefaultBtContext.cc
	* src/DefaultBtContext.h
	* test/MockBtContext.h
2009-02-01 03:29:04 +00:00
Tatsuhiro Tsujikawa 30e183ef54 2009-02-01 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed compiler warning
	* test/IteratableChecksumValidatorTest.cc
2009-02-01 02:50:38 +00:00
Tatsuhiro Tsujikawa 660c480cca 2009-01-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use LongestSequencePieceSelector for HTTP/FTP/BitTorrent
	integrated downloads. This PieceSelector subclass finds the
	longest continuous sequence in the available missing pieces and
	selects the last index of such sequence. This makes HTTP/FTP
	connections less interrupted by the pieces obtained by
	BitTorrent peers.
	* src/DefaultPieceStorage.cc
	* src/DefaultPieceStorage.h
	* src/LongestSequencePieceSelector.cc
	* src/LongestSequencePieceSelector.h
	* src/Makefile.am
	* src/PieceSelector.h
	* src/RarestPieceSelector.h
	* src/RequestGroup.cc
	* test/BtDependencyTest.cc
	* test/DefaultPieceStorageTest.cc
	* test/IteratableChecksumValidatorTest.cc
	* test/LongestSequencePieceSelectorTest.cc
	* test/Makefile.am
	* test/SegmentManTest.cc
2009-01-31 14:34:29 +00:00
Tatsuhiro Tsujikawa e5c4b24454 2009-01-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Send HTTP Authorization header only if it is requested by the
	server(response 401). There are some exceptions. The
	authorization header for proxy is always sent if it is available	
	without request	by the server.  If username/password is specified
	 in the URI, it is immediately sent to the server without
	request by the server.
	
	AbstractAuthResolver::_defaultAuthConfig is now initialized as
	SharedHandle<AuthConfig>().
	NetrcAuthResolver::resolveAuthConfig() returns
	SharedHandle<AuthConfig>() if no AuthConfig is available.
	* src/AbstractAuthResolver.cc
	* src/AbstractProxyRequestCommand.cc
	* src/AuthConfigFactory.cc
	* src/AuthConfigFactory.h
	* src/HttpConnection.cc
	* src/HttpRequest.cc
	* src/HttpRequest.h
	* src/HttpResponse.cc
	* src/HttpResponseCommand.cc
	* src/HttpSkipResponseCommand.cc
	* test/AuthConfigFactoryTest.cc
	* test/HttpRequestTest.cc
	* test/HttpResponseTest.cc
2009-01-30 16:12:41 +00:00
Tatsuhiro Tsujikawa 873231fe1e 2009-01-25 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Rewritten PStringVisitor and its implementation.
	* src/PStringBuildVisitor.cc
	* src/PStringBuildVisitor.h
	* src/PStringDatum.h
	* src/PStringNumLoop.h
	* src/PStringSegment.cc
	* src/PStringSegment.h
	* src/PStringSelect.h
	* src/PStringVisitor.h
	* src/download_helper.cc
	* test/PStringBuildVisitorTest.cc
	* test/ParameterizedStringParserTest.cc
2009-01-25 14:19:27 +00:00
Tatsuhiro Tsujikawa 0742e3921f 2009-01-25 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added experimental built-in HTTP server. Currently, when a
	client accesses to the server, it responds with the current
	download progress. By default, it is disabled. To enable the
	server, give --enable-http-server option.  To change the default
	port number for the server to listen to, use
	--http-server-listen-port option.
	The response HTML is very simple and refreshes it self each 1
	second.  Because of this refresh, you see flicker in normal web
	browser such as Firefox.  I recommend to use console-based
	browser such as elinks, w3m.  To connect to the server, run
	'elinks http://localhost:6800/' while running aria2. Please
	replace port number '6800'(which is default) with your
	preference.	
	* src/DownloadEngineFactory.cc
	* src/HttpHeader.cc
	* src/HttpHeader.h
	* src/HttpHeaderProcessor.cc
	* src/HttpHeaderProcessor.h
	* src/HttpListenCommand.cc
	* src/HttpListenCommand.h
	* src/HttpServer.cc
	* src/HttpServer.h
	* src/HttpServerCommand.cc
	* src/HttpServerCommand.h
	* src/HttpServerResponseCommand.cc
	* src/HttpServerResponseCommand.h
	* src/Makefile.am
	* src/OptionHandlerFactory.cc
	* src/Util.cc
	* src/Util.h
	* src/help_tags.h
	* src/option_processing.cc
	* src/prefs.cc
	* src/prefs.h
	* src/usage_text.h
	* test/HttpHeaderProcessorTest.cc
	* test/UtilTest.cc
2009-01-25 09:58:40 +00:00
Tatsuhiro Tsujikawa 8ca9db9f3e 2009-01-24 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Replaced FileAllocationMan with
	SequentialPicker<FileAllocationEntry>.
	* src/BtCheckIntegrityEntry.cc
	* src/ConsoleStatCalc.cc
	* src/DownloadEngine.cc
	* src/DownloadEngine.h
	* src/DownloadEngineFactory.cc
	* src/FileAllocationCommand.cc
	* src/FileAllocationDispatcherCommand.cc
	* src/FileAllocationMan.h
	* src/Makefile.am
	* src/SequentialPicker.h
	* src/StatCalc.h
	* src/StreamCheckIntegrityEntry.cc
	* test/Makefile.am
	* test/SequentialPickerTest.cc
2009-01-24 09:00:36 +00:00
Tatsuhiro Tsujikawa ca2567f2a2 2009-01-18 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added --bt-max-peers option to specify the maximum number of
	peers per torrent. 0 means unlimited number of peers.
	* src/ActivePeerConnectionCommand.cc
	* src/BtRuntime.h
	* src/DefaultPeerStorage.cc
	* src/DefaultPeerStorage.h
	* src/OptionHandlerFactory.cc
	* src/RequestGroup.cc
	* src/option_processing.cc
	* src/prefs.cc
	* src/prefs.h
	* src/usage_text.h
	* test/DefaultPeerStorageTest.cc
2009-01-18 10:11:08 +00:00
Tatsuhiro Tsujikawa c34ac25683 2009-01-16 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed compile warning/error.
	* src/DownloadResult.h
	* src/HttpDownloadCommand.cc
	* src/ServerStat.cc
	* test/RequestGroupTest.cc
2009-01-15 15:39:05 +00:00
Tatsuhiro Tsujikawa 8a9d921465 2009-01-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Applied exit-status patch from Pascal Rigaux at Mandriva.  aria2
	now returns last error encountered in the HTTP/FTP downloads as
	a exit status value.  If all downloads finished successfully, 
	aria2 returns 0.  The error code is defined in
	src/DownloadResult.h.
	The error occurred in the download currently in progress is not
	reported as a last error.  If no error has encountered but there
	are in progress or waiting downloads, aria2 returns 7.
	
	* src/AbstractCommand.cc
	* src/DlAbortEx.h
	* src/DlRetryEx.h
	* src/DownloadCommand.cc
	* src/DownloadFailureException.h
	* src/DownloadResult.h
	* src/FtpNegotiationCommand.cc
	* src/HttpSkipResponseCommand.cc
	* src/Makefile.am
	* src/MultiUrlRequestInfo.cc
	* src/MultiUrlRequestInfo.h
	* src/RecoverableException.h
	* src/RequestGroup.cc
	* src/RequestGroup.h
	* src/RequestGroupMan.cc
	* src/RequestGroupMan.h
	* src/URIResult.cc
	* src/URIResult.h
	* src/main.cc
	* src/option_processing.cc
	* test/RequestGroupTest.cc
2009-01-12 12:27:34 +00:00
Tatsuhiro Tsujikawa 0a4f43d0ed 2009-01-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Applied AdaptiveURISelector patch from Aurelien Lefebvre.  This
	patch adds AdaptiveURISelector, which selects one of the bests
	mirrors for first and reserved connections. For supplementary
	ones, it returns mirrors which has not been tested yet, and if
	each of them already tested, returns mirrors which has to be
	tested again. Otherwise, it doesn't return anymore mirrors.
	* src/AdaptiveURISelector.cc
	* src/AdaptiveURISelector.h
	* src/FtpNegotiationCommand.cc
	* src/HttpResponseCommand.cc
	* src/Makefile.am
	* src/Makefile.in
	* src/OptionHandlerFactory.cc
	* src/RequestGroup.cc
	* src/RequestGroup.h
	* src/RequestGroupMan.cc
	* src/ServerStat.cc
	* src/ServerStat.h
	* src/ServerStatMan.cc
	* src/SpeedCalc.cc
	* src/URISelector.h
	* src/prefs.cc
	* src/prefs.h
	* test/RequestGroupManTest.cc
	* test/ServerStatManTest.cc
	* test/ServerStatTest.cc
2009-01-06 13:13:42 +00:00
Tatsuhiro Tsujikawa 5325ec4155 2009-01-04 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed unit test error.
	* test/HttpResponseTest.cc 
	(HttpResponseTest::testRetrieveCookie)
2009-01-04 11:37:04 +00:00
Tatsuhiro Tsujikawa 992f82eb5a 2008-12-29 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that BitTorrent download doesn't finish when
	REJECT message is received before CHOKE message.  The old
	implementation doen't clear the use-bit of the piece when
	recieved REJECT message.
	* src/DefaultBtMessageDispatcher.cc
	* test/DefaultBtMessageDispatcherTest.cc
2008-12-29 13:58:21 +00:00
Tatsuhiro Tsujikawa d046c89ea7 2008-12-16 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the cookie implementation based on RFC2965. 
	Now if a value in domain field is not started with dot, then
	prepend dot. That means a cookie with domain=sf.net is sent to
	wiki.sf.net.
	* src/Cookie.cc
	* test/CookieParserTest.cc
	* test/CookieStorageTest.cc
	* test/CookieTest.cc
	* test/NsCookieParserTest.cc
	* test/Sqlite3MozCookieParserTest.cc
2008-12-15 15:48:48 +00:00
Tatsuhiro Tsujikawa 5a639a3d1e 2008-12-16 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that causes corrupted downloads if HTTP pipelining
	is enabled and the server doesn't support keep-alive.
	* src/AbstractCommand.cc
	* src/DownloadCommand.cc
	* src/HttpDownloadCommand.cc
	* src/HttpDownloadCommand.h
	* src/HttpResponseCommand.cc
	* src/Request.cc
	* src/Request.h
	* test/RequestTest.cc
2008-12-15 15:38:07 +00:00
Tatsuhiro Tsujikawa 110749df84 2008-12-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed Dictionary/List/Data and its related classes.
	* src/BencodeVisitor.cc: Removed.
	* src/BencodeVisitor.h: Removed.
	* src/Data.cc: Removed.
	* src/Data.h: Removed.
	* src/Dictionary.cc: Removed.
	* src/Dictionary.h: Removed.
	* src/List.cc: Removed.
	* src/List.h: Removed.
	* src/Makefile.am
	* src/MetaEntry.h: Removed.
	* src/MetaEntryVisitor.h: Removed.
	* src/MetaFileUtil.cc: Removed.
	* src/MetaFileUtil.h: Removed.
	* test/BencodeVisitorTest.cc: Removed.
	* test/DataTest.cc: Removed.
	* test/DictionaryTest.cc: Removed.
	* test/ListTest.cc: Removed.
	* test/Makefile.am
	* test/MetaFileUtilTest.cc: Removed.
2008-12-14 10:21:05 +00:00
Tatsuhiro Tsujikawa 5de92ff1fc 2008-12-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed include of MetaEntry.h
	* test/DHTMessageTrackerEntryTest.cc
2008-12-14 10:16:13 +00:00
Tatsuhiro Tsujikawa 9614ee2fef 2008-12-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use BDE instead of Dictionary/List/Data.
	* src/AnnounceList.cc
	* src/AnnounceList.h
	* test/AnnounceListTest.cc
2008-12-14 10:07:40 +00:00
Tatsuhiro Tsujikawa 9202fe23c8 2008-12-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use BDE instead of Dictionary/List/Data.
	* src/DHTAbstractMessage.cc
	* src/DHTAbstractMessage.h
	* src/DHTAnnouncePeerMessage.cc
	* src/DHTAnnouncePeerMessage.h
	* src/DHTAnnouncePeerReplyMessage.cc
	* src/DHTAnnouncePeerReplyMessage.h
	* src/DHTFindNodeMessage.cc
	* src/DHTFindNodeMessage.h
	* src/DHTFindNodeReplyMessage.cc
	* src/DHTFindNodeReplyMessage.h
	* src/DHTGetPeersMessage.cc
	* src/DHTGetPeersMessage.h
	* src/DHTGetPeersReplyMessage.cc
	* src/DHTGetPeersReplyMessage.h
	* src/DHTMessageFactory.h
	* src/DHTMessageFactoryImpl.cc
	* src/DHTMessageFactoryImpl.h
	* src/DHTMessageReceiver.cc
	* src/DHTMessageTracker.cc
	* src/DHTMessageTracker.h
	* src/DHTPingMessage.cc
	* src/DHTPingMessage.h
	* src/DHTPingReplyMessage.cc
	* src/DHTPingReplyMessage.h
	* src/DHTQueryMessage.cc
	* src/DHTQueryMessage.h
	* src/DHTResponseMessage.cc
	* src/DHTResponseMessage.h
	* test/DHTAnnouncePeerMessageTest.cc
	* test/DHTAnnouncePeerReplyMessageTest.cc
	* test/DHTFindNodeMessageTest.cc
	* test/DHTFindNodeReplyMessageTest.cc
	* test/DHTGetPeersMessageTest.cc
	* test/DHTGetPeersReplyMessageTest.cc
	* test/DHTMessageFactoryImplTest.cc
	* test/DHTMessageTrackerTest.cc
	* test/DHTPingMessageTest.cc
	* test/DHTPingReplyMessageTest.cc
	* test/MockDHTMessageFactory.h
2008-12-14 05:46:45 +00:00
Tatsuhiro Tsujikawa 057132cd5f 2008-12-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added tests the case where length < 0 is specified.
	* test/BencodeTest.cc
2008-12-14 05:44:08 +00:00
Tatsuhiro Tsujikawa b618ada28a 2008-12-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added missing #ifdef guard.  Added uc() function for String and
	removeKey() for Dict.
	* src/bencode.cc
	* src/bencode.h
	* test/BencodeTest.cc
2008-12-14 03:59:24 +00:00
Tatsuhiro Tsujikawa a67ed743a2 2008-12-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use BDE instead of Dictionary/List/Data.
	* src/HandshakeExtensionMessage.cc
	* src/HandshakeExtensionMessage.h
	* test/HandshakeExtensionMessageTest.cc
2008-12-10 14:25:42 +00:00
Tatsuhiro Tsujikawa 8129042a3a 2008-12-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use BDE instead of Dictionary/List/Data classes.
	* src/CompactPeerListProcessor.cc
	* src/CompactPeerListProcessor.h
	* src/DefaultBtAnnounce.cc
	* src/DefaultBtContext.cc
	* src/DefaultBtContext.h
	* src/DefaultPeerListProcessor.cc
	* src/DefaultPeerListProcessor.h
	* src/DelegatingPeerListProcessor.cc
	* src/DelegatingPeerListProcessor.h
	* src/PeerListProcessor.h
	* src/UTPexExtensionMessage.cc
	* src/Util.h
	* src/message.h
	* test/DefaultBtContextTest.cc
	* test/DefaultPeerListProcessorTest.cc
2008-12-09 15:03:29 +00:00
Tatsuhiro Tsujikawa 1b54e64d34 2008-12-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added bencode helper functions and BDE class.
	They will replace MetaFileUtil and Dictionary/List/Data classes.
	* src/Makefile.am
	* src/bencode.cc
	* src/bencode.h
	* test/BencodeTest.cc
	* test/Makefile.am
2008-12-09 14:43:11 +00:00
Tatsuhiro Tsujikawa bd8645262d 2008-12-09 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that bad URI is sent to the tracker when the
	announe URI in torrent file includes query.
	* src/DefaultBtAnnounce.cc
	* test/DefaultBtAnnounceTest.cc
2008-12-09 11:51:07 +00:00
Tatsuhiro Tsujikawa 1e6a579258 2008-12-04 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added Option::blank().
	Use !Option::blank(name) instead of Option::defined(name) for
	the options that take filename.
	* src/MultiUrlRequestInfo.cc
	* src/Option.cc
	* src/Option.h
	* src/main.cc
	* src/option_processing.cc
	* test/OptionTest.cc
2008-12-04 13:05:05 +00:00
Tatsuhiro Tsujikawa 63ddc1f147 2008-12-04 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Enabled --check-certificate by default.  Added compile
	time(configure) option --with-ca-bundle to specify CA bundle.
	Warn if --check-certificate=true and --ca-certificate is not
	specified or loading CA certificate is failed.
	* configure.ac
	* src/MultiUrlRequestInfo.cc
	* src/OptionHandlerFactory.cc
	* src/message.h
2008-12-03 16:07:14 +00:00
Tatsuhiro Tsujikawa b3aa7cef1d 2008-11-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
RFC3986 complied Percent-Encoding(urlencode).
	Use uppercase hexadecimal digits for encoded text instead of
	lowercase ones.
	* src/Request.cc
	* src/Util.cc
	* src/Util.h
	* test/BtHandshakeMessageTest.cc
	* test/DefaultBtAnnounceTest.cc
	* test/DefaultBtContextTest.cc
	* test/RequestTest.cc
	* test/UtilTest.cc
2008-11-27 15:29:15 +00:00
Tatsuhiro Tsujikawa b1edad42ff 2008-11-27 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that prevents aria2 from downloading 0-length
	files via HTTP/FTP.
	* src/DefaultBtContext.cc
	* src/DefaultBtContext.h
	* src/DownloadContext.h
	* src/FtpNegotiationCommand.cc
	* src/HttpResponseCommand.cc
	* src/HttpResponseCommand.h
	* src/RequestGroup.cc
	* src/SingleFileDownloadContext.cc
	* src/SingleFileDownloadContext.h
	* test/BtPostDownloadHandlerTest.cc
	* test/MetalinkPostDownloadHandlerTest.cc
	* test/MockBtContext.h
2008-11-26 15:22:54 +00:00
Tatsuhiro Tsujikawa 72d523b990 2008-11-26 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Applied aria2-1.0.1-mingw.patch.
	Use SOCKET_ERRNO instead of errno if the code is used both linux
	and mingw.
	Collected 4th and 5th argument types for getsockopt and
	setsockopt.
	* src/SocketCore.cc
	* src/a2netcompat.h
	* test/SocketCoreTest.cc
2008-11-26 12:50:07 +00:00
Tatsuhiro Tsujikawa 9e7a497fd9 2008-11-24 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Closed files after the test cases in MultiDiskWriterTest::
	testResetDiskWriterEntries(). This will fix the unit test error
	in mingw32 build.
	* test/MultiDiskWriterTest.cc
2008-11-24 11:13:58 +00:00
Tatsuhiro Tsujikawa 62105714ef 2008-11-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use HEAD method to get file size from HTTP server for segmented
	downloading.
	The request to the BitTorrent Tracker always uses GET method
	because the response of the tracker is small and it doesn't need
	segmented download.
	* src/FtpNegotiationCommand.cc
	* src/HttpRequest.cc
	* src/HttpResponseCommand.cc
	* src/HttpSkipResponseCommand.cc
	* src/RequestGroup.cc
	* src/RequestGroup.h
	* src/TrackerWatcherCommand.cc
	* test/HttpRequestTest.cc
2008-11-23 15:00:44 +00:00
Tatsuhiro Tsujikawa c104ac8319 2008-11-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that causes floating exception when -T option is
	used and no URIs are given.
	* src/download_helper.cc
	* test/DownloadHelperTest.cc
2008-11-23 12:13:53 +00:00
Ross Smith II 67d5d6d55e Applied aria2-1.0.0-mingw-r5.patch 2008-11-22 20:28:50 +00:00
Tatsuhiro Tsujikawa 931bd985db 2008-11-19 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Do not urlencode Request::url in setUrl() because we want
	unmodified URL using Request::getUrl()
	* src/Request.cc
	* src/Request.h
	* test/RequestTest.cc
2008-11-18 15:10:47 +00:00
Tatsuhiro Tsujikawa a38e367f7f 2008-11-18 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Excluded testLoad_compat() and testLoad_nonBt_compat() when
	compiled on big endian systems because test .aria2 files are
	made for little	endian systems.
	* test/DefaultBtProgressInfoFileTest.cc
2008-11-18 11:28:04 +00:00
Tatsuhiro Tsujikawa 091dad70cc 2008-11-18 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Dropped ares support.
	* README
	* configure.ac
	* m4/libares.m4: Removed.
	* src/AsyncNameResolver.cc
	* src/Makefile.am
	* test/Makefile.am
2008-11-18 11:20:53 +00:00