Commit Graph

665 Commits (ae957baa98d4f97ea2437596db5073f9c33d22ae)

Author SHA1 Message Date
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
Tatsuhiro Tsujikawa b0029fa4bf 2008-11-17 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Rewritten ByteArrayDiskWriter::size() using seekg() and tellg().
	Removed const qualifier from DiskWriter::size().
	* src/AbstractDiskWriter.cc
	* src/AbstractDiskWriter.h
	* src/ByteArrayDiskWriter.cc
	* src/ByteArrayDiskWriter.h
	* src/DiskWriter.h
	* test/ByteArrayDiskWriterTest.cc
2008-11-17 12:07:24 +00:00
Tatsuhiro Tsujikawa 7bcf0f48b2 2008-11-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Instead of creating special filename in createDownloadResult()
	if inMemoryDownload() is true, now it is done in getFilePath().
	* src/RequestGroup.cc
	* test/RequestGroupTest.cc
2008-11-14 12:32:54 +00:00
Tatsuhiro Tsujikawa b62b860ba0 2008-11-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added input_uris.txt to EXTRA_DIST
	* test/Makefile.am
2008-11-13 16:14:03 +00:00
Tatsuhiro Tsujikawa 86478c49dd 2008-11-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed compile error without SSL/XML library.
	* src/DefaultBtProgressInfoFile.cc
	* src/DefaultBtProgressInfoFile.h
	* src/FileMetalinkParserState.cc
	* src/RequestGroup.h
	* src/SocketCore.cc
	* src/SocketCore.h
	* src/VerificationMetalinkParserState.cc
	* src/download_helper.h
	* src/main.cc
	* test/DefaultBtProgressInfoFileTest.cc
	* test/DownloadHelperTest.cc
2008-11-13 15:08:52 +00:00
Tatsuhiro Tsujikawa eed0406484 2008-11-13 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Rewritten URI handling functions. They are now provided as a
	testable functions.
	* src/Makefile.am
	* src/RequestGroup.cc
	* src/RequestGroup.h
	* src/download_helper.cc
	* src/download_helper.h
	* src/main.cc
	* test/DownloadHelperTest.cc
	* test/Makefile.am
	* test/input_uris.txt
2008-11-13 13:40:40 +00:00
Tatsuhiro Tsujikawa 05a9313e19 2008-11-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added the ability to specify output filename and directory in
	input file.
	Additional parameters are added in the following line of URIs
	with proceeding white space(s), 1 parameter in 1 line.
	The parameter names are the same with the command-line option
	name without proceeding "--". Not all the options are available
	here: at the moment, 'dir' and 'out' options are avialable.
	Please note that out option has no effect against Metalink or
	BitTorrentdownloads.
	Example input file:
	
	http://host/foo-1.1.tar.bz2
	  out=foo.tar.bz2
	  dir=/tmp/downloads
	http://host/thundermonkey-2.0.tar.bz2

	And then invoke 'aria2c -i url.txt --dir ~/mydownloads'.
	foo-1.1.tar.bz2 is saved as /tmp/downloads/foo.tar.bz2, whereas
	thundermonkey-2.0.tar.bz2 is saved as
	~/mydownloads/thundermonkey-2.0.tar.bz2.
	* src/BtPostDownloadHandler.cc
	* src/Metalink2RequestGroup.cc
	* src/Metalink2RequestGroup.h
	* src/MetalinkPostDownloadHandler.cc
	* src/UriListParser.cc
	* src/UriListParser.h
	* src/main.cc
	* test/Metalink2RequestGroupTest.cc
	* test/UriListParserTest.cc
	* test/filelist1.txt
2008-11-11 14:56:46 +00:00
Tatsuhiro Tsujikawa 896eab9967 2008-11-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed bad cast in 32bit platforms.
	* test/DefaultPieceStorageTest.cc
	(DefaultPieceStorageTest::testGetCompletedLength)
2008-11-11 11:37:27 +00:00
Tatsuhiro Tsujikawa ebf4fc62fa 2008-11-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed unit test fails on 32bit platforms.
	* test/CookieParserTest.cc
2008-11-10 16:18:39 +00:00
Tatsuhiro Tsujikawa 82b80c33d8 2008-11-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that metalink file is not processed if
	Content-Type field has a paramter.
	* src/HttpResponse.cc
	* src/HttpResponse.h
	* test/HttpResponseTest.cc
2008-11-10 16:08:22 +00:00
Tatsuhiro Tsujikawa e5e19ddeb9 2008-11-10 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that DefaultPieceStorage::getCompletedLength()
	returns the value larger than DefaultPieceStorage::getTotalLength()
	when in flight pieces are involved.
	* src/DefaultPieceStorage.cc
	* test/DefaultPieceStorageTest.cc
2008-11-10 13:21:08 +00:00
Tatsuhiro Tsujikawa 5c4910f71e 2008-11-08 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed the bug that the DiskWriter of the first FileEntry whose
	`needsFileAllocation' property is false is not created
	even if it shares a piece with next FileEntry which `requested'
	property is true.
	Fixed the bug that zero-length file is not created if pre file
	allocation is not done.
	* src/MultiDiskAdaptor.cc
	* src/MultiDiskAdaptor.h
	* test/MultiDiskAdaptorTest.cc
2008-11-08 08:36:40 +00:00
Tatsuhiro Tsujikawa 93a49e4840 2008-11-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added the ability to pool proxy connection.
	The conneciton in FTP with proxy-method=GET is not pooled.
	Proxy-Connection header will not be sent when sending CONNECT
	method.
	* src/DownloadEngine.cc
	* src/DownloadEngine.h
	* src/FtpFinishDownloadCommand.cc
	* src/FtpInitiateConnectionCommand.cc
	* src/FtpNegotiationCommand.cc
	* src/HttpDownloadCommand.cc
	* src/HttpInitiateConnectionCommand.cc
	* src/HttpRequest.cc
	* src/HttpRequest.h
	* src/HttpResponse.cc
	* src/HttpSkipResponseCommand.cc
	* test/HttpRequestTest.cc
	* test/HttpResponseTest.cc
2008-11-05 12:30:22 +00:00
Tatsuhiro Tsujikawa 4797b0e72d 2008-11-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Handle date before epoch.
	To create *bad* Time object, call Time::null().
	* src/CookieParser.cc
	* src/FtpConnection.cc
	* src/FtpConnection.h
	* src/FtpNegotiationCommand.cc
	* src/RequestGroup.cc
	* src/TimeA2.cc
	* src/TimeA2.h
	* test/CookieParserTest.cc
	* test/FtpConnectionTest.cc
	* test/TimeTest.cc
2008-11-05 10:30:43 +00:00
Tatsuhiro Tsujikawa c7fb678e6e 2008-11-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Deprecated --http-proxy-user and --http-proxy-passwd options.
	Added --https-proxy, --ftp-proxy and --all-proxy options.
	Above 3 options and --http-proxy option can handle proxy in URL
	format like: http://user:passwd@host:port.
	If a proxy requires user/password, they must be specified in a
	URL.
	Deprecated --ftp-via-http-proxy option. Use --http-proxy-method
	option instead.
	* src/AbstractCommand.cc
	* src/AbstractCommand.h
	* src/AbstractProxyRequestCommand.cc
	* src/AbstractProxyRequestCommand.h
	* src/AuthConfigFactory.cc
	* src/AuthConfigFactory.h
	* src/FtpFinishDownloadCommand.cc
	* src/FtpInitiateConnectionCommand.cc
	* src/FtpInitiateConnectionCommand.h
	* src/FtpNegotiationCommand.cc
	* src/FtpTunnelRequestCommand.cc
	* src/FtpTunnelRequestCommand.h
	* src/HttpDownloadCommand.cc
	* src/HttpInitiateConnectionCommand.cc
	* src/HttpInitiateConnectionCommand.h
	* src/HttpProxyRequestCommand.cc
	* src/HttpProxyRequestCommand.h
	* src/HttpRequest.cc
	* src/HttpRequest.h
	* src/HttpRequestCommand.cc
	* src/HttpRequestCommand.h
	* src/HttpSkipResponseCommand.cc
	* src/InitiateConnectionCommand.cc
	* src/InitiateConnectionCommand.h
	* src/OptionHandlerFactory.cc
	* src/OptionHandlerImpl.h
	* src/Request.cc
	* src/option_processing.cc
	* src/prefs.cc
	* src/prefs.h
	* src/usage_text.h
	* test/AuthConfigFactoryTest.cc
	* test/HttpRequestTest.cc
	* test/OptionHandlerTest.cc
2008-11-04 14:08:26 +00:00
Tatsuhiro Tsujikawa 0b7033abb7 2008-11-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added testcase for BtNotInterestedMessage from unchoked peer.
	* test/BtNotInterestedMessageTest.cc
2008-11-03 12:06:39 +00:00
Tatsuhiro Tsujikawa 6d01f8f94f 2008-11-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Execute choking algorithm when BtInterestedMessage arrives from
	unchoked peer.
	* src/BtInterestedMessage.cc
	* src/BtInterestedMessage.h
	* src/DefaultBtMessageFactory.cc
	* test/BtInterestedMessageTest.cc
	* test/MockPeerStorage.h
2008-11-03 12:04:57 +00:00
Tatsuhiro Tsujikawa 8fab0ff216 2008-11-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
AuthConfigFactory is now part of DownloadEngine.
	* src/AbstractProxyRequestCommand.cc
	* src/AuthConfigFactory.h
	* src/DownloadEngine.cc
	* src/DownloadEngine.h
	* src/FtpConnection.cc
	* src/FtpConnection.h
	* src/FtpNegotiationCommand.cc
	* src/HttpConnection.cc
	* src/HttpRequest.cc
	* src/HttpRequest.h
	* src/HttpRequestCommand.cc
	* src/HttpResponse.cc
	* src/HttpResponseCommand.cc
	* src/HttpSkipResponseCommand.cc
	* src/MultiUrlRequestInfo.cc
	* src/main.cc
	* test/FtpConnectionTest.cc
	* test/HttpRequestTest.cc
	* test/HttpResponseTest.cc
2008-11-03 10:06:25 +00:00
Tatsuhiro Tsujikawa 928e228c89 2008-11-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
DNSCache is now part of DownloadEngine.
	* src/DNSCache.h
	* src/DownloadEngine.cc
	* src/DownloadEngine.h
	* src/InitiateConnectionCommand.cc
	* src/MultiUrlRequestInfo.cc
	* test/Makefile.am
	* test/Makefile.in
	* test/SimpleDNSCacheTest.cc
2008-11-03 08:18:58 +00:00
Tatsuhiro Tsujikawa 220a483004 2008-11-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Removed SingletonHolder of CUIDCounter. CUIDCounter is now part 
	of DownloadEngine.
	* src/ActivePeerConnectionCommand.cc
	* src/BtSetup.cc
	* src/CUIDCounter.h
	* src/DHTSetup.cc
	* src/DownloadCommand.cc
	* src/DownloadEngine.cc
	* src/DownloadEngine.h
	* src/DownloadEngineFactory.cc
	* src/FileAllocationDispatcherCommand.cc
	* src/InitiatorMSEHandshakeCommand.cc
	* src/PeerInitiateConnectionCommand.cc
	* src/PeerInteractionCommand.cc
	* src/PeerListenCommand.cc
	* src/RequestGroup.cc
	* src/StreamFileAllocationEntry.cc
	* src/TrackerWatcherCommand.cc
	* src/main.cc
	* test/RequestGroupManTest.cc
2008-11-03 07:49:13 +00:00
Tatsuhiro Tsujikawa 7818e0e770 2008-11-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Implemented commented code in BtSeederStateChoke
	* src/BtSeederStateChoke.cc
	* src/Peer.cc
	* src/Peer.h
	* src/PeerInteractionCommand.cc
	* src/PeerSessionResource.cc
	* src/PeerSessionResource.h
	* test/MockBtMessageDispatcher.h
	* test/PeerSessionResourceTest.cc
2008-11-03 07:16:25 +00:00