Commit Graph

442 Commits (933866e315cc40f010a095c7eb030c801591208d)

Author SHA1 Message Date
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
Tatsuhiro Tsujikawa 7cf589e784 2008-11-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Made BtRegistry non-static object. Now DownloadEngine has a
	reference to its object.
	* src/AbstractBtMessage.cc
	* src/ActivePeerConnectionCommand.cc
	* src/ActivePeerConnectionCommand.h
	* src/BtContextAwareCommand.cc
	* src/BtContextAwareCommand.h
	* src/BtExtendedMessage.cc
	* src/BtExtendedMessage.h
	* src/BtInterestedMessage.cc
	* src/BtInterestedMessage.h
	* src/BtNotInterestedMessage.cc
	* src/BtNotInterestedMessage.h
	* src/BtRegistry.cc
	* src/BtRegistry.h
	* src/BtSeederStateChoke.cc
	* src/BtSetup.cc
	* src/DHTGetPeersCommand.cc
	* src/DHTGetPeersCommand.h
	* src/DHTPeerAnnounceEntry.cc
	* src/DHTPeerAnnounceEntry.h
	* src/DHTPeerAnnounceStorage.cc
	* src/DHTPeerAnnounceStorage.h
	* src/DHTPeerLookupTask.cc
	* src/DHTPeerLookupTask.h
	* src/DHTSetup.cc
	* src/DHTSetup.h
	* src/DHTTaskFactory.h
	* src/DHTTaskFactoryImpl.cc
	* src/DHTTaskFactoryImpl.h
	* src/DefaultBtAnnounce.cc
	* src/DefaultBtInteractive.cc
	* src/DefaultBtInteractive.h
	* src/DefaultBtMessageDispatcher.cc
	* src/DefaultBtMessageDispatcher.h
	* src/DefaultBtMessageFactory.cc
	* src/DefaultBtMessageFactory.h
	* src/DefaultBtMessageReceiver.cc
	* src/DefaultBtProgressInfoFile.cc
	* src/DefaultBtProgressInfoFile.h
	* src/DefaultBtRequestFactory.cc
	* src/DefaultBtRequestFactory.h
	* src/DefaultExtensionMessageFactory.cc
	* src/DefaultExtensionMessageFactory.h
	* src/DefaultPeerStorage.cc
	* src/DefaultPeerStorage.h
	* src/DownloadEngine.cc
	* src/DownloadEngine.h
	* src/InitiatorMSEHandshakeCommand.cc
	* src/InitiatorMSEHandshakeCommand.h
	* src/MSEHandshake.cc
	* src/MSEHandshake.h
	* src/Makefile.am
	* src/Makefile.in
	* src/PeerChokeCommand.cc
	* src/PeerChokeCommand.h
	* src/PeerInitiateConnectionCommand.cc
	* src/PeerInitiateConnectionCommand.h
	* src/PeerInteractionCommand.cc
	* src/PeerInteractionCommand.h
	* src/PeerObject.h
	* src/PeerReceiveHandshakeCommand.cc
	* src/PeerReceiveHandshakeCommand.h
	* src/ReceiverMSEHandshakeCommand.cc
	* src/RequestGroup.cc
	* src/RequestGroup.h
	* src/RequestGroupMan.cc
	* src/RequestGroupMan.h
	* src/SeedCheckCommand.cc
	* src/SeedCheckCommand.h
	* src/ShareRatioSeedCriteria.h
	* src/SimpleBtMessage.cc
	* src/TrackerWatcherCommand.cc
	* src/TrackerWatcherCommand.h
	* src/UTPexExtensionMessage.cc
	* src/UTPexExtensionMessage.h
	* test/BtCancelMessageTest.cc
	* test/BtChokeMessageTest.cc
	* test/BtExtendedMessageTest.cc
	* test/BtInterestedMessageTest.cc
	* test/BtNotInterestedMessageTest.cc
	* test/BtPieceMessageTest.cc
	* test/BtPortMessageTest.cc
	* test/BtRegistryTest.cc
	* test/BtRejectMessageTest.cc
	* test/BtRequestMessageTest.cc
	* test/DHTPeerAnnounceEntryTest.cc
	* test/DHTPeerAnnounceStorageTest.cc
	* test/DefaultBtMessageDispatcherTest.cc
	* test/DefaultBtMessageFactoryTest.cc
	* test/DefaultBtProgressInfoFileTest.cc
	* test/DefaultBtRequestFactoryTest.cc
	* test/DefaultExtensionMessageFactoryTest.cc
	* test/MSEHandshakeTest.cc
	* test/MockDHTTaskFactory.h
	* test/ShareRatioSeedCriteriaTest.cc
	* test/UTPexExtensionMessageTest.cc
2008-11-03 06:49:02 +00:00
Tatsuhiro Tsujikawa 93edc7bd20 2008-10-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed compiler warning.
	* test/UtilTest.cc
2008-10-27 14:33:14 +00:00
Tatsuhiro Tsujikawa 915aa676f8 2008-10-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Treat Cookie object as session cookie if expiry = 0 is given.
	With this change, you can specify session scoped cookies in an
	external file setting expiry value to 0.
	* src/Cookie.cc
	* src/Cookie.h
	* test/CookieParserTest.cc
	* test/CookieStorageTest.cc
	* test/CookieTest.cc
2008-10-26 14:22:58 +00:00
Tatsuhiro Tsujikawa 8a920ba5e3 2008-10-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Changed signature of DHTMessageFactory::createResponseMessage().
	Removed unused validateIDMatch.
	* src/DHTMessageFactory.h
	* src/DHTMessageFactoryImpl.cc
	* src/DHTMessageFactoryImpl.h
	* src/DHTMessageTracker.cc
	* test/DHTMessageFactoryImplTest.cc
	* test/MockDHTMessageFactory.h

	Dropped DHT message coming from same ID of localhost.
	* src/DHTMessageReceiver.cc

	Rejected adding node whose ID is the same as localhost's.
	* src/DHTRoutingTable.cc
	* test/BtPortMessageTest.cc
	* test/DHTRoutingTableTest.cc
2008-10-26 12:36:41 +00:00
Tatsuhiro Tsujikawa 837585e095 2008-10-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed compiler warning.
	* test/UtilTest.cc
2008-10-20 12:33:38 +00:00
Tatsuhiro Tsujikawa c0c80adaa2 2008-10-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added length equality test to operator== to drop a piece message
	whose length does not match to the requested one.
	* src/RequestSlot.cc
	* test/DefaultBtMessageDispatcherTest.cc
2008-10-19 14:57:58 +00:00
Tatsuhiro Tsujikawa 2040d64fe5 2008-10-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that aria2 aborts when a request larger than 16KiB 
is
	recieved.
	In this fix, if a request larger than 16KiB length is received, 
aria2
	disconnects the peer.
	* src/BtConstants.h
	* src/PeerMessageUtil.cc
	* src/PeerMessageUtil.h
	* test/BtRequestMessageTest.cc
2008-10-19 14:53:30 +00:00
Tatsuhiro Tsujikawa 6ef72a14a2 2008-10-13 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed compile warning on linux-amd64
	* src/FtpConnection.cc
	* src/IteratableChunkChecksumValidator.cc
	* src/MultiDiskAdaptor.cc

	Fixed the bug that unit test fails on linux-amd64
	* test/UtilTest.cc
2008-10-12 16:09:12 +00:00
Tatsuhiro Tsujikawa 1605b39a10 2008-10-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that last character in URI is not encoded.
	* src/Request.cc
	* test/RequestTest.cc
2008-10-08 16:06:27 +00:00
Tatsuhiro Tsujikawa 22af8b4b22 2008-10-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that referer header field contains fragment.
	Now Request class removes fragment part of URI and encodes it
	in Request::setUri() and setReferer().
	* src/Request.h
	* src/Request.cc
	* test/RequestTest.cc
2008-10-08 15:35:52 +00:00
Tatsuhiro Tsujikawa a7018cb595 2008-10-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added missing m4 macros.
	* m4/cppunit.m4
	* m4/libgcrypt.m4
	* m4/libgnutls-extra.m4
	* m4/libgnutls.m4
	* m4/libxml2.m4
2008-10-08 14:18:01 +00:00
Tatsuhiro Tsujikawa bb1ee91509 2008-10-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added test for Time::elapsed(time_t).
	* test/TimeTest.cc
2008-10-05 15:24:17 +00:00
Tatsuhiro Tsujikawa 389f770008 2008-10-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Made socket for dht connections non-blocking
	* src/DHTAbstractMessage.cc
	* src/DHTAbstractMessage.h
	* src/DHTConnection.h
	* src/DHTConnectionImpl.cc
	* src/DHTConnectionImpl.h
	* src/DHTMessage.h
	* src/DHTMessageDispatcherImpl.cc
	* src/DHTMessageDispatcherImpl.h
	* src/DHTUnknownMessage.cc
	* src/DHTUnknownMessage.h
	* src/SocketCore.cc
	* src/SocketCore.h
	* test/MockDHTMessage.h
2008-10-05 13:21:14 +00:00
Tatsuhiro Tsujikawa a00c9ca392 2008-10-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Use sqlite3_open if sqlite3_open_v2 is not available.
	* src/Sqlite3MozCookieParser.cc
	* src/Sqlite3MozCookieParser.h
	* m4/sqlite3.m4
	* test/Sqlite3MozCookieParserTest.cc
2008-10-04 03:02:35 +00:00
Tatsuhiro Tsujikawa c682371a58 2008-10-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Don't set Request::supportsPersistentConnection() in 
HttpConnection
	since this code is also used in AbstractProxyResponseCommand.
	Moved those code to HttpResponse.
	* src/HttpResponse.cc
	* src/HttpResponse.h
	* src/HttpConnection.cc
	* src/HttpConnection.h
	* src/HttpResponseCommand.cc
	* test/HttpResponseTest.cc
2008-09-30 15:54:50 +00:00
Tatsuhiro Tsujikawa 87a5bb50c2 2008-09-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Reverted previous change.
	Insert username+'@' to URI(after ftp://) when URI is FTP scheme 
and
	username is not in URI.
	* src/HttpRequest.cc
	* src/Request.cc
	* test/HttpRequestTest.cc
	* test/RequestTest.cc
2008-09-25 16:06:29 +00:00
Tatsuhiro Tsujikawa 789e1926cb 2008-09-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Now colon is required for username and password in FTP URL, 
like:
	ftp://username:password@host.
	If colon is not there, aria2 don't parse it as a username. For 
example,
	aria2 don't retrieve username from ftp://username@host.
	This fix was made in order to login FTP server via 
non-transparent ftp
	proxy.
	* src/Request.cc
	* test/RequestTest.cc
2008-09-25 14:48:38 +00:00
Tatsuhiro Tsujikawa 92d702fa53 2008-09-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Use netrc for HTTP.
	Now FTP user/password is sent in Authorization header when
	--ftp-via-http-proxy=get is given.
	* src/AuthConfigFactory.cc
	* src/HttpRequest.cc
	* src/HttpRequest.h
	* src/NetrcAuthResolver.cc
	* src/NetrcAuthResolver.h
	* src/OptionHandlerFactory.cc
	* src/option_processing.cc
	* src/prefs.cc
	* src/prefs.h
	* test/AuthConfigFactoryTest.cc
	* test/HttpRequestTest.cc
	* test/NetrcAuthResolverTest.cc
2008-09-25 14:37:28 +00:00
Tatsuhiro Tsujikawa 6bc233f414 2008-09-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Issue PWD command first and get working directory and use it as 
a prefix
	for CWD command.
	* src/DownloadEngine.cc
	* src/DownloadEngine.h
	* src/FtpConnection.cc
	* src/FtpConnection.h
	* src/FtpFinishDownloadCommand.cc
	* src/FtpInitiateConnectionCommand.cc
	* src/FtpNegotiationCommand.cc
	* src/FtpNegotiationCommand.h
	* test/FtpConnectionTest.cc
2008-09-24 17:01:57 +00:00
Tatsuhiro Tsujikawa f66ed483fa 2008-09-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Integrated HelpItem into OptionParser to ease the workload for 
adding
	new options. Removed default value from usage text.
	* src/HelpItem.cc: Removed.
	* src/HelpItem.h: Removed.
	* src/HelpItemFactory.cc: Removed.
	* src/HelpItemFactory.h: Removed.
	* src/Makefile.am
	* src/Makefile.in
	* src/NameMatchOptionHandler.h
	* src/OptionHandler.cc
	* src/OptionHandler.h
	* src/OptionHandlerFactory.cc
	* src/OptionHandlerImpl.h
	* src/OptionParser.cc
	* src/OptionParser.h
	* src/TagContainer.cc: Removed.
	* src/TagContainer.h: Removed.
	* src/TaggedItem.cc: Removed.
	* src/TaggedItem.h: Removed.
	* src/main.cc
	* src/option_processing.cc
	* src/usage_text.h
	* src/version_usage.cc
	* test/HelpItemTest.cc: Removed.
	* test/Makefile.am
	* test/Makefile.in
	* test/OptionHandlerTest.cc
	* test/OptionParserTest.cc
	* test/TagContainerTest.cc: Removed.
2008-09-22 09:26:57 +00:00
Tatsuhiro Tsujikawa 67767e2f61 2008-09-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that a block in a piece is requested when same 
block is
	already requested to the same peer in end game mode.
	* src/BtRequestFactory.h
	* src/DefaultBtInteractive.cc
	* src/DefaultBtRequestFactory.cc
	* src/DefaultBtRequestFactory.h
	* src/DefaultPieceStorage.cc
	* src/DefaultPieceStorage.h
	* src/PieceStorage.h
	* src/UnknownLengthPieceStorage.cc
	* src/UnknownLengthPieceStorage.h
	* test/DefaultBtRequestFactoryTest.cc
	* test/DefaultPieceStorageTest.cc
	* test/MockBtRequestFactory.h
	* test/MockPieceStorage.h
2008-09-19 14:11:41 +00:00
Tatsuhiro Tsujikawa c1ba5c9745 2008-09-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that prefixLength of split bucket which doesn't 
include
	local node ID is incremented.
	* src/DHTBucket.cc
	* src/DHTBucket.h
	* test/DHTBucketTest.cc
2008-09-18 13:21:33 +00:00
Tatsuhiro Tsujikawa e7d462bb39 2008-09-17 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added cookies.sqlite to EXTRA_DIST
	* test/Makefile.am
2008-09-17 13:37:32 +00:00
Tatsuhiro Tsujikawa 479a16edd6 2008-09-14 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added upper limit of FTP response buffer. The current 
implementation
	uses 4096bytes as a limit.
	* src/FtpConnection.cc
	* src/FtpConnection.h
	* test/FtpConnectionTest.cc
2008-09-14 12:51:30 +00:00
Tatsuhiro Tsujikawa 1b2a76706f 2008-09-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that bulkReceiveResponse() reads all received data 
as a
	response even if more than one response is in it.
	* src/FtpConnection.cc
	* src/FtpConnection.h
	* test/FtpConnectionTest.cc
2008-09-09 15:22:32 +00:00
Tatsuhiro Tsujikawa eb652b570e 2008-09-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Implemented the ability to get timestamp from remote FTP server 
using
	MDTM command described in RFC3659.
	* src/FtpConnection.cc
	* src/FtpConnection.h
	* src/FtpNegotiationCommand.cc
	* src/FtpNegotiationCommand.h
	* test/FtpConnectionTest.cc
	* test/Makefile.am
2008-09-08 13:06:44 +00:00
Tatsuhiro Tsujikawa dbc8f5b737 2008-09-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Implemented the ability to get timestamp from remote HTTP server 
and
	apply it to local file. To enable this feature, --remote-time 
option
	is added. No usage text has been written yet.
	If several servers returns difference timestamp, then aria2 uses 
latest
	one.
	* src/CopyDiskAdaptor.cc
	* src/CopyDiskAdaptor.h
	* src/DirectDiskAdaptor.cc
	* src/DirectDiskAdaptor.h
	* src/DiskAdaptor.h
	* src/File.cc
	* src/File.h
	* src/HttpHeader.cc
	* src/HttpHeader.h
	* src/HttpResponse.cc
	* src/HttpResponse.h
	* src/HttpResponseCommand.cc
	* src/HttpResponseCommand.h
	* src/MultiDiskAdaptor.cc
	* src/MultiDiskAdaptor.h
	* src/OptionHandlerFactory.cc
	* src/RequestGroup.cc
	* src/RequestGroup.h
	* src/RequestGroupMan.cc
	* src/option_processing.cc
	* src/prefs.cc
	* src/prefs.h
	* test/CopyDiskAdaptorTest.cc
	* test/FileTest.cc
	* test/Makefile.am
	* test/Makefile.in
	* test/MultiDiskAdaptorTest.cc
	* test/TestUtil.cc
2008-09-07 14:38:26 +00:00
Tatsuhiro Tsujikawa 4e28efd925 2008-09-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that DiskWriterEntry is not created when its
	FileEntry.isRequested() is false and it doesn't share a piece 
with
	other FileEntries that are requested. This bug causes 
segmentation fault
	in the end.
2008-09-07 11:37:15 +00:00
Tatsuhiro Tsujikawa 390538d0b5 2008-09-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that exception is thrown when 
MultiDiskAdaptor::size() is
	called if the number of file entries are greater than max open 
files.
	* src/AbstractSingleDiskAdaptor.cc
	* src/AbstractSingleDiskAdaptor.h
	* src/DiskAdaptor.h
	* src/MultiDiskAdaptor.cc
	* src/MultiDiskAdaptor.h
	* test/MultiDiskAdaptorTest.cc
2008-09-07 08:29:09 +00:00
Tatsuhiro Tsujikawa 5fb94a3af0 2008-09-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added a constuctor that receives struct timeval.
	Added operator<.
	* src/TimeA2.cc
	* src/TimeA2.h
	* test/TimeTest.cc
2008-09-07 04:57:31 +00:00
Tatsuhiro Tsujikawa b624a12ed0 2008-09-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Parse `expires' of Set-Cookie using Time::parseHTTPDate()
	* src/CookieParser.cc
	* test/CookieParserTest.cc
	* test/HttpResponseTest.cc
2008-09-07 04:36:41 +00:00
Tatsuhiro Tsujikawa 69b18308d9 2008-09-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Implmented the functions to parse date.
	* src/TimeA2.cc
	* src/TimeA2.h
	* test/TimeTest.cc
2008-09-07 04:19:11 +00:00
Tatsuhiro Tsujikawa 9fc8b15736 2008-09-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added "Firefox3 Cookie" feature to FeatureConfig
	* src/FeatureConfig.cc
	* src/FeatureConfig.h
	* test/FeatureConfigTest.cc
2008-09-05 15:34:04 +00:00
Tatsuhiro Tsujikawa 574ca31e38 2008-09-02 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Contact tracker frequently when the number of connections are 0	
and
	download is not finished yet.
	* src/ActivePeerConnectionCommand.cc
	* src/BtAnnounce.h
	* src/DefaultBtAnnounce.cc
	* src/DefaultBtAnnounce.h
	* test/MockBtAnnounce.h
2008-09-02 13:51:46 +00:00
Tatsuhiro Tsujikawa c46b6055c6 2008-09-02 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Moved threthold values to UTPexExtensionMessage.
	* src/DefaultBtInteractive.cc
	* src/Peer.cc
	* src/Peer.h
	* src/UTPexExtensionMessage.cc
	* src/UTPexExtensionMessage.h
	* test/UTPexExtensionMessageTest.cc
2008-09-02 12:31:04 +00:00
Tatsuhiro Tsujikawa 6779c72b5d 2008-09-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Made Cookie immutable.
	* src/Cookie.cc
	* src/Cookie.h
	* src/CookieParser.cc
	* src/CookieParser.h
	* src/CookieStorage.cc
	* test/CookieParserTest.cc
	* test/CookieStorageTest.cc
	* test/NsCookieParserTest.cc
	* test/Sqlite3MozCookieParserTest.cc
2008-09-01 15:00:41 +00:00
Tatsuhiro Tsujikawa 398d53f5f5 2008-09-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Use CookieStorage class instead of CookieBox class.
	Now CookieStorage accepts cookies from numeric host such as 
192.168.1.1.
	* src/AbstractProxyRequestCommand.cc
	* src/CookieStorage.cc
	* src/DownloadEngine.cc
	* src/DownloadEngine.h
	* src/HttpConnection.cc
	* src/HttpConnection.h
	* src/HttpRequest.cc
	* src/HttpRequest.h
	* src/HttpRequestCommand.cc
	* src/HttpResponse.cc
	* src/HttpResponseCommand.cc
	* src/HttpSkipResponseCommand.cc
	* src/Makefile.am
	* src/MultiUrlRequestInfo.cc
	* src/Request.cc
	* src/Request.h
	* src/main.cc
	* test/AllTest.cc
	* test/CookieStorageTest.cc
	* test/CookieTest.cc
	* test/HttpRequestTest.cc
	* test/HttpResponseTest.cc
	* test/Makefile.am
	* test/NsCookieParserTest.cc
	* test/Sqlite3MozCookieParserTest.cc
	* test/nscookietest.txt
2008-09-01 13:46:03 +00:00
Tatsuhiro Tsujikawa f670cdbba9 2008-08-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Updated
	* test/Cookies.sqlite
	* test/nscookietest.txt
2008-08-27 16:33:09 +00:00
Tatsuhiro Tsujikawa 9ac91413dd 2008-08-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added tests for CookieStorage::load()
	* test/CookieStorageTest.cc
2008-08-27 16:31:43 +00:00
Tatsuhiro Tsujikawa 9cdcbf32ff 2008-08-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added CookieStorage class which is based on RFC2109 and manages 
cookies
	more strictly than CookieBox and CookieBoxFactory class.
	* src/CookieStorage.cc
	* src/CookieStorage.h
	* src/Cookie.cc
	* src/Cookie.h
	* test/CookieStorageTest.cc
	* test/CookieTest.cc
2008-08-27 16:04:36 +00:00
Tatsuhiro Tsujikawa a50048aa54 2008-08-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Removed DirectDiskAdaptorTest.h
	* test/Makefile.am
2008-08-26 12:53:43 +00:00
Tatsuhiro Tsujikawa 76a9ad9c84 2008-08-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed chunk checksum validation cannot detect trailing garbage 
data.
	BUG#2074141
	* src/AbstractSingleDiskAdaptor.cc
	* src/AbstractSingleDiskAdaptor.h
	* src/CheckIntegrityEntry.cc
	* src/CheckIntegrityEntry.h
	* src/DiskAdaptor.h
	* src/MultiDiskAdaptor.cc
	* src/MultiDiskAdaptor.h
	* src/RequestGroup.cc
	* test/DirectDiskAdaptorTest.cc
	* test/MultiDiskAdaptorTest.cc
	* test/TestUtil.cc
	* test/TestUtil.h
2008-08-26 12:39:07 +00:00
Tatsuhiro Tsujikawa 15101a89a0 2008-08-25 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Bump up version number of dht.dat file to 3. In version 3 
format, time
	is stored in 64bit, network byte order.
	New build can load old format(version 2) but it saves the file 
in new
	format. It means once you used new build, your dht.dat becomes
	incompatible with older build.
	* src/DHTRoutingTableDeserializer.cc
	* src/DHTRoutingTableSerializer.cc
	* test/DHTRoutingTableSerializerTest.cc
2008-08-25 11:55:30 +00:00
Tatsuhiro Tsujikawa d9668e2c23 2008-08-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added load-v0001.aria2 and load-nonBt-v0001.aria2 to EXTRA_DIST.
	* test/Makefile.am
2008-08-24 09:46:03 +00:00
Tatsuhiro Tsujikawa 335a0fb36f 2008-08-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Bump up version number of .aria2 control file to 0001.
	New aria2 can still load version 0000 file but it saves the file 
in
	version 0001 format. It means that new aria2 can resume download
	started by old aria2 but the opposite is not true.
	* src/DefaultBtProgressInfoFile.cc
	* src/DefaultBtProgressInfoFile.h
	* test/DefaultBtProgressInfoFileTest.cc
2008-08-24 09:43:45 +00:00
Tatsuhiro Tsujikawa 02dde388b8 2008-08-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added ntoh64 and hton64 as inline functions.
	* src/Util.cc
	* test/UtilTest.cc
2008-08-24 07:55:34 +00:00
Tatsuhiro Tsujikawa ef2478b246 2008-08-24 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Save temporary file first and rename to the destination on 
success.
	Added test cases.
	* src/RequestGroupMan.cc
	* test/RequestGroupManTest.cc
2008-08-23 15:42:06 +00:00
Tatsuhiro Tsujikawa 0e6c0498a3 2008-08-17 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
If a cookie whose expire date is later than 2038-01-19 03:14:07 
GMT is
	sent from server, its expire date is assumed to 2038-01-19 
03:14:07 GMT.
	If Util::httpGMT is failed, then Cookie::onetime is set to true.
	* src/Util.cc
	* src/Util.h
	* src/CookieParser.cc
	* test/UtilTest.cc
	* test/CookieParserTest.cc
2008-08-17 14:09:03 +00:00
Tatsuhiro Tsujikawa adfcf57e32 2008-08-17 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Seprate the implementation to load old mozilla format of cookie 
to
	NsCookieParser class.
	* src/CookieBoxFactory.cc
	* src/CookieBoxFactory.h
	* src/NsCookieParser.cc
	* src/NsCookieParser.h
	* test/NsCookieParserTest.cc
2008-08-17 12:58:56 +00:00
Tatsuhiro Tsujikawa 0cac0dabde 2008-08-17 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added firefox3 cookie support based on the patch submitted by
	tizianomueller.
	firefox3 cookie is SQLite3 database. libsqlite3 is required to 
enable
	this functionality.
	* configure.ac
	* m4/sqlite3.m4
	* src/CookieBoxFactory.cc
	* src/CookieBoxFactory.h
	* src/Makefile.am
	* src/Makefile.in
	* src/Sqlite3MozCookieParser.cc
	* src/Sqlite3MozCookieParser.h
	* src/main.cc
	* test/CookieBoxFactoryTest.cc
	* test/Makefile.am
	* test/Makefile.in
	* test/Sqlite3MozCookieParserTest.cc
	* test/badcookies.sqlite
	* test/cookies.sqlite
2008-08-17 10:44:12 +00:00
Tatsuhiro Tsujikawa 326d11bc46 2008-08-14 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed occasional assertion failure in PieceSegment.
	Calling PieceStorage::getMissingPiece(size_t) was missing after
	canceling segments in SegmentMan::getSegment(int32_t). This 
resulted in
	creation of duplicate segments and one of the segment was 
finished then
	assertion failure was caused.
	* src/SegmentMan.cc
	* test/SegmentManTest.cc
2008-08-13 16:13:54 +00:00
Tatsuhiro Tsujikawa db46bab38b 2008-08-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added options to load/save the server's performance/status to a	
file
	and the timeout to drop their data.
	--server-stat-of=FILE specifies the file to which performance 
data
	is saved.
	--server-stat-if=FILE specifies the file to read previously 
saved
	by --server-stat-of option. Might be used with 
--uri-selector=feedback.
	--server-stat-timeout=TIMEOUT specifies timeout to invalidate 
the data.
	TIMEOUT is specified in seconds and the default value is 
24hours.
	* src/MultiUrlRequestInfo.cc
	* src/OptionHandlerFactory.cc
	* src/RequestGroupMan.cc
	* src/RequestGroupMan.h
	* src/ServerStatMan.cc
	* src/ServerStatMan.h
	* src/option_processing.cc
	* src/prefs.cc
	* src/prefs.h
	* test/ServerStatManTest.cc
2008-08-10 15:22:55 +00:00
Tatsuhiro Tsujikawa 6aba376430 2008-08-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Implemented ServerStatMan::removeStaleServerStat() and its test 
case.
	* src/ServerStatMan.cc
	* src/ServerStatMan.h
	* test/ServerStatManTest.cc
2008-08-09 13:30:40 +00:00
Tatsuhiro Tsujikawa d85014b937 2008-08-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Implemented ServerStatMan::load(...) function and its test case.
	* src/ServerStat.cc
	* src/ServerStat.h
	* src/ServerStatMan.cc
	* test/ServerStatManTest.cc
	* test/ServerStatTest.cc
2008-08-09 11:29:27 +00:00
Tatsuhiro Tsujikawa 26690f692b 2008-08-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Implemented ServerStatMan::save(...) function and its test case.
	* src/ServerStat.cc
	* src/ServerStat.h
	* src/ServerStatMan.cc
	* src/ServerStatMan.h
	* test/ServerStatManTest.cc
2008-08-09 09:59:56 +00:00
Tatsuhiro Tsujikawa 70b457da01 2008-08-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Now aria2 uses name attribute in Metalink as local filename in
	BitTorrent downloads. BUG#2033999
	* src/BtContext.h
	* src/BtDependency.cc
	* src/DefaultBtContext.cc
	* src/DefaultBtContext.h
	* src/SingleFileDownloadContext.cc
	* src/SingleFileDownloadContext.h
	* test/BtDependencyTest.cc
	* test/DefaultBtContextTest.cc
	* test/MockBtContext.h
2008-08-08 16:44:59 +00:00
Tatsuhiro Tsujikawa 4baee78941 2008-08-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Eliminated randomness from the test case. Removed #ifdef 
__MINGW32
	directive.
	* test/DefaultPieceStorageTest.cc
2008-08-07 14:25:52 +00:00
Tatsuhiro Tsujikawa fcb7254bf5 2008-08-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed memory leak in test code
	* test/AnnounceListTest.cc
	* test/DefaultPeerListProcessorTest.cc
	* test/DefaultPeerStorageTest.cc
	* test/MetaFileUtilTest.cc
2008-08-07 14:21:50 +00:00
Tatsuhiro Tsujikawa 49c4f82561 2008-08-07 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Removed max chunk size check. This change fixes BUG#2040169
	* src/ChunkedDecoder.cc
	* src/ChunkedDecoder.h
	* test/ChunkedDecoderTest.cc
2008-08-07 14:06:03 +00:00
Tatsuhiro Tsujikawa d64c8e75f6 2008-08-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Implemented download speed based URI selection algorithm.
	Introduced new option --uri-selector.
	If --uri-selector=feedback is given, aria2 uses download speed 
observed
	in the previous downloads and chooses fastest server in the URI 
list.
	Currently at most 10 URIs are considered to introduce 
randomeness for
	finding better servers. The speed is average download speed in 
the
	downloads.
	On the other hand, if --uri-selector=inorder is given, which is 
default,
	URI is tried in order in URI list.
	The usage text for the new option has not been written yet.
	* src/AbstractCommand.cc
	* src/DownloadCommand.cc
	* src/DownloadEngine.cc
	* src/DownloadEngineFactory.cc
	* src/InOrderURISelector.cc
	* src/InOrderURISelector.h
	* src/OptionHandlerFactory.cc
	* src/PeerStat.h
	* src/RequestGroup.cc
	* src/RequestGroup.h
	* src/RequestGroupMan.cc
	* src/RequestGroupMan.h
	* src/SegmentMan.cc
	* src/SegmentMan.h
	* src/ServerStat.cc
	* src/ServerStat.h
	* src/ServerStatMan.cc
	* src/ServerStatMan.h
	* src/ServerStatURISelector.cc
	* src/ServerStatURISelector.h
	* src/URISelector.h
	* src/option_processing.cc
	* src/prefs.cc
	* src/prefs.h
	* test/InOrderURISelectorTest.cc
	* test/RequestGroupManTest.cc
	* test/ServerStatManTest.cc
	* test/ServerStatURISelectorTest.cc
2008-08-04 17:06:47 +00:00
Tatsuhiro Tsujikawa f7e3651d91 2008-07-31 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Applied tizianomueller's patch to fix compile error.
	* test/BitfieldManTest.cc
	* test/BtRequestMessageTest.cc
	* test/DefaultBtContextTest.cc
	* test/DefaultDiskWriterTest.cc
	* test/DefaultPieceStorageTest.cc
	* test/HttpHeaderProcessorTest.cc
	* test/HttpResponseTest.cc
	* test/Metalink2RequestGroupTest.cc
	* test/MetalinkParserControllerTest.cc
	* test/MetalinkProcessorTest.cc
	* test/PeerSessionResourceTest.cc
	* test/UtilTest.cc
2008-07-31 12:28:12 +00:00
Tatsuhiro Tsujikawa 3e4b748412 2008-07-23 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added GZip to `Enabled Features' list.
	* src/FeatureConfig.cc
	* src/FeatureConfig.h
	* test/FeatureConfigTest.cc
2008-07-22 16:05:02 +00:00
Tatsuhiro Tsujikawa ec395b6a9c 2008-07-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Now SegmentMan::findSlowerSegmentEntry() picks up the segment 
for which
	the transfer has not yet started.
	Rewritten SegmentMan::registerPeerStat() and 
SegmentMan::getPeerStat().
	* src/SegmentMan.cc
	* src/SegmentMan.h
	* test/SegmentManTest.cc
2008-07-20 07:55:10 +00:00
Tatsuhiro Tsujikawa 5d2651c5ed 2008-07-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Supported absolute/relative path in Location header field.
	* src/AbstractCommand.cc: Call resetUrl() when DlRetryEx is 
caught.
	* src/HttpHeader.cc
	* src/HttpHeader.h
	* src/HttpResponse.cc
	* src/HttpSkipResponseCommand.cc
	* src/Request.cc
	* test/HttpHeaderTest.cc
	* test/HttpResponseTest.cc
	* test/RequestTest.cc
2008-07-18 15:20:52 +00:00
Tatsuhiro Tsujikawa 750e40a221 2008-07-13 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Regenerated test/Makefile.in to remove stale ChangeLog.
	* test/Makefile.in
2008-07-13 12:46:24 +00:00
Tatsuhiro Tsujikawa aec1e9e7e1 2008-07-13 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added the ability to save signature when download is completed 
if
	signature is available. The filename of signature file is the 
path to
	download file followed by ".sig". If it already exists, then 
signature
	will not be saved.
	* src/RequestGroupMan.cc
	* src/Signature.cc
	* test/SignatureTest.cc
2008-07-12 15:09:03 +00:00
Tatsuhiro Tsujikawa 5472c8033e 2008-07-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added the ability to retrieve signature from Metalink file.
	A retrieved signature is stored in Signature class and it is 
held by
	DownloadContext class. Note that aria2 doesn't verify signature.
	* src/DownloadContext.cc
	* src/DownloadContext.h
	* src/Makefile.am
	* src/Makefile.in
	* src/Metalink2RequestGroup.cc
	* src/MetalinkEntry.cc
	* src/MetalinkEntry.h
	* src/MetalinkParserController.cc
	* src/MetalinkParserController.h
	* src/MetalinkParserStateMachine.cc
	* src/MetalinkParserStateMachine.h
	* src/Signature.cc
	* src/Signature.h
	* src/SignatureMetalinkParserState.cc
	* src/SignatureMetalinkParserState.h
	* src/VerificationMetalinkParserState.cc
	* src/VerificationMetalinkParserState.h
	* test/Metalink2RequestGroupTest.cc
	* test/MetalinkParserControllerTest.cc
	* test/MetalinkProcessorTest.cc
	* test/test.xml
2008-07-12 13:35:35 +00:00
Tatsuhiro Tsujikawa cefbf6407e 2008-07-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added the test for the previous change in DefaultBtContext.cc
	* test/DefaultBtContextTest.cc
2008-07-12 07:41:15 +00:00
Tatsuhiro Tsujikawa 92c66d24ac 2008-07-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Rewritten ChunkedEncoding class as ChunkedDecoder class.
	* src/A2STR.cc
	* src/A2STR.h
	* src/ChunkedDecoder.cc
	* src/ChunkedDecoder.h
	* src/ChunkedEncoding.cc: Removed
	* src/ChunkedEncoding.h: Removed
	* src/DownloadCommand.cc
	* src/DownloadCommand.h
	* src/HttpDownloadCommand.cc
	* src/HttpResponse.cc
	* src/HttpResponse.h
	* src/HttpResponseCommand.cc
	* src/HttpSkipResponseCommand.cc
	* src/HttpSkipResponseCommand.h
	* src/Makefile.am
	* src/TransferEncoding.h: Removed
	* test/ChunkedDecoderTest.cc
	* test/ChunkedEncodingTest.cc: Removed
	* test/HttpResponseTest.cc
	* test/Makefile.am
2008-07-01 11:38:25 +00:00
Tatsuhiro Tsujikawa d791807add 2008-06-29 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added gzip, deflate decoding support in HTTP using libz. If 
compiled
	with this feature, aria2 sends "Accept-Encoding: deflate, gzip" 
header
	to a HTTP server. If a server returns "Content-Encoding: gzip" 
or
	"Content-Encoding: deflate" then, aria2 decodes the response 
body on the
	fly and writes decoded data to a local disk.
	* README
	* README.html
	* configure.ac
	* m4/aria2_arg.m4: Added ARIA2_ARG_WITH and ARIA2_ARG_ENABLE, 
they are
	wrapper function for AC_ARG_WITH and AC_ARG_ENABLE respectively.
	* m4/libz.m4
	* src/Decoder.h
	* src/DownloadCommand.cc
	* src/DownloadCommand.h
	* src/Exception.h
	* src/GZipDecoder.cc
	* src/GZipDecoder.h
	* src/HttpHeader.cc
	* src/HttpHeader.h
	* src/HttpRequest.cc
	* src/HttpRequest.h
	* src/HttpResponse.cc
	* src/HttpResponse.h
	* src/HttpResponseCommand.cc
	* src/Makefile.am
	* test/GZipDecoderTest.cc
	* test/HttpRequestTest.cc
	* test/HttpResponseTest.cc
	* test/Makefile.am
	* test/Makefile.in
	* test/gzip_decode_test.gz
2008-06-29 14:29:36 +00:00
Tatsuhiro Tsujikawa dfe2f99345 2008-06-17 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Filled up pieces based on the number of missing blocks, rather 
than
	simplay the number of piece * block length.
	* src/BtRequestFactory.h
	* src/DefaultBtInteractive.cc
	* src/DefaultBtInteractive.h
	* src/DefaultBtRequestFactory.cc
	* src/DefaultBtRequestFactory.h
	* src/Piece.cc
	* src/Piece.h
	* test/BitfieldManTest.cc
	* test/DefaultBtRequestFactoryTest.cc
	* test/MockBtRequestFactory.h
2008-06-17 11:43:29 +00:00
Tatsuhiro Tsujikawa d4b29c84fc 2008-06-17 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Cancel download if http redirect is bounded more than 20 times.
	* src/AbstractCommand.cc
	* src/HttpSkipResponseCommand.cc
	* src/Request.cc
	* src/Request.h
	* test/RequestTest.cc
2008-06-17 09:09:31 +00:00
Tatsuhiro Tsujikawa 8989ffb6c5 2008-06-16 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Applied Ross's aria2-0.13.2+1-mingw-4.patch. With this change, 
all
	changes in the patch were applied.
	* test/DHTConnectionImplTest.cc: Fixed unit test error in MinGW.
	* test/DefaultPieceStorageTest.cc: Fixed unit test error in 
MinGW.
	* test/PeerMessageUtilTest.cc: Fixed unit test error in MinGW.
2008-06-16 13:26:25 +00:00
Tatsuhiro Tsujikawa aaa2ecaa6f 2008-06-16 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Applied Ross's aria2-0.13.2+1-mingw-4.patch. In this commit, 
only the
	follow sources are applied.
	* src/Platform.h: I removed HAVE_WINSOCK2_H directive from 
Platform.h.
	* src/Platform.cc: Moved common setup/teardown code to Platform 
class.
	I moved #endif // HAVE_WINSOCK2_H to the front of #include 
"DlAbortEx.h"
	I included locale.h from Platform.cc.
	* src/main.cc: Moved common setup/teardown code to Platform 
class.
	* test/AllTest.cc: Use Platform class.
	Set locale to C in AllTest.cc to prevent the messages to be 
localized.
2008-06-16 11:59:34 +00:00
Tatsuhiro Tsujikawa 06644332c2 2008-06-16 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Applied Ross's aria2-0.13.2+1-mingw-3.patch.
	* test/HttpHeaderTest.cc: Casted to off_t where it should.
	* test/HttpRequestTest.cc: Casted to off_t where it should.
2008-06-16 11:27:52 +00:00
Tatsuhiro Tsujikawa 2f8e184fe5 2008-06-16 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Create only requested files and files which shares a piece with
	requested file in multi-torrent downloads. Directory structures 
are
	also created in the same rule.
	MultiDiskAdaptor::fileExists() now uses FileEntry instead of
	DiskWriterEntry as in the previous implementation.
	* src/MultiDiskWriter.cc
	* src/MultiFileAllocationIterator.cc
	* src/MultiFileAllocationIterator.h
	* test/MultiFileAllocationIteratorTest.cc
2008-06-15 16:19:06 +00:00
Tatsuhiro Tsujikawa 95ca33bba3 2008-06-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Bump up version number to 0.14.0b.
	* src/configure.ac
2008-06-10 14:31:08 +00:00
Tatsuhiro Tsujikawa 7a74971caa 2008-06-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Always remove a peer from cache in 
DefaultPeerStorage::returnPeer(),
	to make room more fleshy, recently found peers.
	Peer::_badConditionStartTime is not used anymore. Consider to 
remove
	it.
	* src/DefaultPeerStorage.cc
	* test/DefaultPeerStorageTest.cc
2008-06-10 11:29:10 +00:00
Tatsuhiro Tsujikawa 7d63daed22 2008-06-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Calculate piece hash when data is arrived if the data is arrived 
in
	order. This removes additional read operation for hash 
calculation.
	If the data is arrived in out of order, the hash is calucated 
when the
	piece is completed. This is the same behavior as the old 
implementation.
	* src/BtPieceMessage.cc
	* src/DefaultBtProgressInfoFile.cc
	* src/DefaultPieceStorage.cc
	* src/DownloadCommand.cc
	* src/DownloadCommand.h
	* src/DownloadEngine.cc
	* src/GrowSegment.cc
	* src/GrowSegment.h
	* src/Piece.cc
	* src/Piece.h
	* src/PiecedSegment.cc
	* src/PiecedSegment.h
	* src/Segment.h
	* test/PieceTest.cc
2008-06-04 16:28:16 +00:00
Tatsuhiro Tsujikawa 242267028d 2008-05-31 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* test/MetalinkEntryTest.cc: Added missing `defined' keyword to 
#if
	directive.
2008-05-31 10:27:21 +00:00
Tatsuhiro Tsujikawa 1d7b5e6f4a 2008-05-31 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Reduced the usage of gettimeofday().
	* src/DefaultBtMessageDispatcher.cc
	
(DefaultBtMessageDispatcher::checkRequestSlotAndDoNecessaryThing)
	(class FindStaleRequestSlot, class ProcessStaleRequestSlot)
	* src/RequestSlot.cc
	* src/RequestSlot.h
	(RequestSlot::isTimeout)
	
	Made RequestSlot have a reference to Piece object to avoid find
	Piece repeatedly.
	* src/DefaultBtMessageDispatcher.cc
	(class FindStaleRequestSlot, class ProcessStaleRequestSlot)
	* src/RequestSlot.cc
	* src/RequestSlot.h
	(RequestSlot::getPiece)
	* test/DefaultBtMessageDispatcherTest.cc
2008-05-31 05:46:16 +00:00
Tatsuhiro Tsujikawa 8a653fe38b 2008-05-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed compile error when configured with --disable-bittorrent
	* test/DownloadHandlerFactoryTest.cc
2008-05-21 08:43:46 +00:00
Tatsuhiro Tsujikawa 65c7d8f26c 2008-05-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Refactored. Use std::string instead of size and char*.
	* Data.cc
	* Data.h
	* test/Data.cc
2008-05-21 07:18:31 +00:00
Tatsuhiro Tsujikawa 4749763419 Moved DownloadHandlerFactoryTest.cc to SRC in Makefile.am. 2008-05-20 15:18:25 +00:00
Tatsuhiro Tsujikawa bf58b49d87 2008-05-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed compile error when configured with --disable-metalink.
	Also moved test/DownloadHandlerFactoryTest.cc to SRC in 
Makefile.am.
	* test/FeatureConfigTest.cc
	* test/DownloadHandlerFactoryTest.cc
2008-05-20 14:27:58 +00:00
Tatsuhiro Tsujikawa a70a747c23 2008-05-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed compile error when configured with --without-gnutls
	--without-openssl
	* src/main.cc
	* test/DefaultBtProgressInfoFileTest.cc
	* test/SegmentManTest.cc
2008-05-20 00:42:34 +00:00
Tatsuhiro Tsujikawa ff6b5ecc9c 2008-05-19 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Returns const reference:
	DownloadContext::getPieceHash, DownloadContext::getName,
	DownloadContext::getPieceHashAlgo, DownloadContext::getDir,
	BtContext::getInfoHashAsString,
	* src/BtContext.h
	* src/DefaultBtContext.cc
	* src/DefaultBtContext.h
	* src/DownloadContext.h
	* src/SingleFileDownloadContext.h
	* test/MockBtContext.h
2008-05-19 11:28:17 +00:00
Tatsuhiro Tsujikawa 40471d1c47 Updated Makefile to compile RarestPieceSelectorTest.cc 2008-05-17 12:53:03 +00:00
Tatsuhiro Tsujikawa ef02915d82 2008-05-17 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Put piece selection strategy algorithm to RarestPieceSelector 
class,
	Added a switch to choose whether randomized selection so that 
unit
	tests emit same results in, possibly, win32.
	* src/DefaultPieceStorage.cc
	* src/DefaultPieceStorage.h
	* src/RarestPieceSelector.cc
	* src/RarestPieceSelector.h
	* test/DefaultPieceStorageTest.cc
	* test/RarestPieceSelectorTest.cc
2008-05-17 12:51:54 +00:00
Tatsuhiro Tsujikawa b5f1ca6f66 2008-05-17 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Sort RequestSlot in ascending order and manipulate them using
	lower_bound.
	* src/DefaultBtMessageDispatcher.cc
	* src/DefaultBtMessageDispatcher.h
	(getMessageQueue): Added const qualifier.
	(getRequestSlots): Added const qualifier.
	(sendMessages): Use empty() instead of size().
	(doCancelSendingPieceAction): Use HandleEvent object.
	(doAbortOutstandingRequestAction): Rewritten.
	(doChokedAction): Rewritten.
	(checkRequestSlotAndDoNecessaryThing): Rewritten.
	(isOutstandingRequest): Rewritten.
	(getOutstandingRequest): Rewritten.
	(removeOutstandingRequest): Rewritten.
	(addOutstandingRequest): Rewritten.
	* src/RequestSlot.cc
	* src/RequestSlot.h
	(operator=): Rewritten.
	(operator!=): New function.
	(operator<): New function.
2008-05-17 07:31:32 +00:00
Tatsuhiro Tsujikawa 41b6003cbd 2008-05-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Changed method signature:
	BtContext::computeFastSet, DefaultBtContext::extractUrlList
	* src/BtContext.h
	* src/DefaultBtContext.cc
	* src/DefaultBtContext.h
	* src/DefaultBtInteractive.cc
	* test/DefaultBtContextTest.cc
	* test/MockBtContext.h
2008-05-12 12:18:21 +00:00
Tatsuhiro Tsujikawa 3da60af41e 2008-05-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Changed method sinature:
	MetalinkEntry::toFileEntry,
	MetalinkHelper::query, MetalinkHelper::parseAndQuery,
	Metalinker::queryEntry
	* src/Metalink2RequestGroup.cc
	* src/MetalinkEntry.cc
	* src/MetalinkEntry.h
	* src/MetalinkHelper.cc
	* src/MetalinkHelper.h
	* src/Metalinker.cc
	* src/Metalinker.h
	* src/main.cc
	* test/MetalinkHelperTest.cc
	* test/MetalinkerTest.cc
2008-05-12 11:39:34 +00:00
Tatsuhiro Tsujikawa f84eac327f 2008-05-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Changed method sinature:
	RequestGroup::getURIs
	* src/RequestGroup.cc
	* src/RequestGroup.h
	* test/Metalink2RequestGroupTest.cc
2008-05-12 11:15:17 +00:00
Tatsuhiro Tsujikawa 5f8e8e371e 2008-05-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Changed method signature:
	PeerListProcessor::extractPeer
	* src/CompactPeerListProcessor.cc
	* src/CompactPeerListProcessor.h
	* src/DefaultBtAnnounce.cc
	* src/DefaultPeerListProcessor.cc
	* src/DefaultPeerListProcessor.h
	* src/DelegatingPeerListProcessor.cc
	* src/DelegatingPeerListProcessor.h
	* src/PeerListProcessor.h
	* src/UTPexExtensionMessage.cc
	* test/DefaultPeerListProcessorTest.cc
2008-05-12 11:05:21 +00:00
Tatsuhiro Tsujikawa ddd1206b42 2008-05-12 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Changed method signature:
	BtRequestFactory::createRequestMessages,
	BtRequestFactory::createRequestMessagesOnEndGame
	* src/BtRequestFactory.h
	* src/DefaultBtInteractive.cc
	* src/DefaultBtRequestFactory.cc
	* src/DefaultBtRequestFactory.h
	* test/DefaultBtRequestFactoryTest.cc
	* test/MockBtRequestFactory.h
2008-05-12 10:54:36 +00:00
Tatsuhiro Tsujikawa d2110dc697 2008-05-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Changed method signature:
	PieceStorage::getInFlightPieces
	* src/DefaultBtProgressInfoFile.cc
	* src/DefaultPieceStorage.cc
	* src/DefaultPieceStorage.h
	* src/PieceStorage.h
	* src/UnknownLengthPieceStorage.cc
	* src/UnknownLengthPieceStorage.h
	* test/DefaultBtProgressInfoFileTest.cc
	* test/MockPieceStorage.h
2008-05-11 14:42:34 +00:00
Tatsuhiro Tsujikawa b96eb7fd79 2008-05-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Changed method signature:
	PostDownloadHandler::getNextRequestGroups
	Metalink2RequestGroup::generate
	RequestGroup::postDownloadProcessing
	* src/BtPostDownloadHandler.cc
	* src/BtPostDownloadHandler.h
	* src/Metalink2RequestGroup.cc
	* src/Metalink2RequestGroup.h
	* src/MetalinkPostDownloadHandler.cc
	* src/MetalinkPostDownloadHandler.h
	* src/PostDownloadHandler.h
	* src/RequestGroup.cc
	* src/RequestGroup.h
	* src/RequestGroupMan.cc
	* src/main.cc
	* test/BtPostDownloadHandlerTest.cc
	* test/Metalink2RequestGroupTest.cc
	* test/MetalinkPostDownloadHandlerTest.cc
2008-05-11 13:59:27 +00:00
Tatsuhiro Tsujikawa 05f0646112 2008-05-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Changed method signature:
	PeerStorage::getActivePeers
	* src/DHTPeerAnnounceEntry.cc
	* src/DefaultPeerStorage.cc
	* src/DefaultPeerStorage.h
	* src/PeerStorage.h
	* test/DefaultPeerStorageTest.cc
	* test/MockPeerStorage.h
2008-05-11 12:58:48 +00:00
Tatsuhiro Tsujikawa 33e916547a 2008-05-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Changed method signature:
	DHTPeerAnnounceStorage::getPeers,
	DHTPeerAnnounceEntry::getPeers
	* src/DHTGetPeersMessage.cc
	* src/DHTPeerAnnounceEntry.cc
	* src/DHTPeerAnnounceEntry.h
	* src/DHTPeerAnnounceStorage.cc
	* src/DHTPeerAnnounceStorage.h
	* test/DHTAnnouncePeerMessageTest.cc
	* test/DHTPeerAnnounceEntryTest.cc
	* test/DHTPeerAnnounceStorageTest.cc
2008-05-11 12:14:14 +00:00
Tatsuhiro Tsujikawa 7ec7b7ea60 2008-05-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Changed method signature:
	PieceStorage::getAdvertisedPieceIndexes
	* src/DefaultBtInteractive.cc
	* src/DefaultPieceStorage.cc
	* src/DefaultPieceStorage.h
	* src/PieceStorage.h
	* src/UnknownLengthPieceStorage.h
	* test/MockPieceStorage.h
2008-05-11 10:57:18 +00:00
Tatsuhiro Tsujikawa 82e0092b19 2008-05-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Changed method signature:
	SegmentMan::getInFlightSegment
	* src/AbstractCommand.cc
	* src/SegmentMan.cc
	* src/SegmentMan.h
	* test/SegmentManTest.cc
2008-05-11 10:46:52 +00:00
Tatsuhiro Tsujikawa 6d78a7656d 2008-05-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Changed method signature:
	BNode::findClosestKNodes, BNode:: enumerateBucket,
	DHTBucket::getGoodNodes,
	DHTRoutingTable::getClosestKNodes, DHTRoutingTable::getBuckets
	* src/BNode.cc
	* src/BNode.h
	* src/DHTAbstractNodeLookupTask.cc
	* src/DHTAutoSaveCommand.cc
	* src/DHTBucket.cc
	* src/DHTBucket.h
	* src/DHTBucketRefreshTask.cc
	* src/DHTFindNodeMessage.cc
	* src/DHTGetPeersMessage.cc
	* src/DHTRoutingTable.cc
	* src/DHTRoutingTable.h
	* test/BNodeTest.cc
	* test/DHTBucketTest.cc
	* test/DHTRoutingTableTest.cc
2008-05-11 08:07:57 +00:00
Tatsuhiro Tsujikawa bf5a8c3f78 2008-05-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
In piece selection functions, Pass std::deque<...> by reference 
rather
	than returning it.
	* src/BitfieldMan.cc
	* src/BitfieldMan.h
	* src/DefaultBtRequestFactory.cc
	* src/DefaultPieceStorage.cc
	* src/Piece.cc
	* src/Piece.h
	* test/BitfieldManTest.cc
2008-05-11 07:37:46 +00:00
Tatsuhiro Tsujikawa a702d60666 2008-05-11 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Implemented rarest piece first piece selection strategy.
	* src/AbstractBtMessage.cc
	* src/AbstractBtMessage.h
	* src/BitfieldMan.cc
	* src/BitfieldMan.h
	* src/BtBitfieldMessage.cc
	* src/BtHaveAllMessage.cc
	* src/BtHaveMessage.cc
	* src/DefaultPieceStorage.cc
	* src/DefaultPieceStorage.h
	* src/PeerInteractionCommand.cc
	* src/PieceStorage.h
	* src/UnknownLengthPieceStorage.h
2008-05-11 01:22:32 +00:00
Tatsuhiro Tsujikawa 03db925988 2008-05-10 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Pool connection when a server returns 4xx, 5xx responses.
	* src/HttpNullDownloadCommand.cc
	* src/HttpNullDownloadCommand.h
	* src/HttpResponse.cc
	* src/HttpResponse.h
	* src/HttpResponseCommand.cc
	* src/HttpResponseCommand.h
	* test/HttpResponseTest.cc
2008-05-10 04:50:49 +00:00
Tatsuhiro Tsujikawa 5ea933fed1 2008-05-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Set _supportsPersistentConnection to true by default.
	* src/Request.cc
	* src/RequestGroup.cc
	* test/HttpRequestTest.cc
	* test/RequestTest.cc
2008-05-08 13:20:15 +00:00
Tatsuhiro Tsujikawa 8fab8859b1 2008-05-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed misuse of multimap::find()
	* src/HttpHeader.cc
	* test/HttpHeaderTest.cc
2008-05-08 11:39:37 +00:00
Tatsuhiro Tsujikawa 874714609f 2008-05-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Fixed the bug that the control file(.aria2 file) is not renamed
	according to tryAutoFileRenaming().
	tryAutoFileRenaming() was rewritten so that if both renamed file 
and
	its control file exist, use them and continue download.
	The old implementation didn't take into account of control 
file's
	existence, so basically you couldn't continue download of 
renamed file.
	* src/BtProgressInfoFile.h
	* src/DefaultBtProgressInfoFile.cc
	* src/DefaultBtProgressInfoFile.h
	* src/NullProgressInfoFile.h
	* src/RequestGroup.cc
	* test/DefaultBtProgressInfoFileTest.cc
	* test/MockBtProgressInfoFile.h
2008-05-05 10:10:15 +00:00
Tatsuhiro Tsujikawa f596de9eec 2008-05-05 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Reimplemented transparent metalink using Accept request header.
	* src/HttpRequest.cc
	* src/HttpRequest.h
	* src/HttpRequestCommand.cc
	* src/Metalink2RequestGroup.cc
	* src/RequestGroup.cc
	* src/RequestGroup.h
	* test/HttpRequestTest.cc
2008-05-05 08:25:41 +00:00
Tatsuhiro Tsujikawa b74e27ff92 2008-04-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Reorganized version information so that it can be displayed in a
	standard terminal screen without scrolling.
	Removed http, ftp from Configuration section, because they are 
always
	enabled.
	* src/FeatureConfig.cc
	* src/FeatureConfig.h
	* src/main.cc
	* src/messageDigest.cc
	* src/messageDigest.h
	* src/version_usage.cc
	* test/FeatureConfigTest.cc
2008-04-27 05:55:02 +00:00
Tatsuhiro Tsujikawa 4663902500 2008-04-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Removed query part from filename in HTTP download. The query part means
	the substring after "?" in URL. Firefox seems do the same thing.
	A query part is sometimes very long and not suitable to filename,
	so I think it is better to remove it from filename.
	* src/HttpRequest.cc
	* src/HttpRequest.h
	* src/Request.cc
	* src/Request.h
	* test/HttpRequestTest.cc
	* test/RequestTest.cc
2008-04-27 04:09:08 +00:00
Tatsuhiro Tsujikawa 1ef99931e1 2008-04-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Rewritten Exception class. Throw exception object, not its pointer and
	catch by reference, so that remove problematic delete operator for
	catched exception.
	* src/Exception.cc
	* src/Exception.h
	* test/ExceptionTest.cc
	* src/*: All files throwing/catching exception.
	* test/*: All files throwing/catching exception.
2008-04-27 02:22:14 +00:00
Tatsuhiro Tsujikawa 90d5b5c0a2 2008-04-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added StringFormat class, which internally calls vasprintf.
	operator<< is defined for this class, so it can be used with iostream
	classes nicely. SimpleLogger and following functions are rewritten
	using StringFormat class.
	Besides, now Logger class's methods are non-const, many classes
	that has a const Logger* as a member variable are modified to remove
	const qualifier from the variable declaration.
	* src/HelpItemFactory.cc
	* src/Request.cc
	* src/SimpleLogger.cc
	* src/StringFormat.cc
	* src/StringFormat.h
	* src/Util.cc
	* src/option_processing.cc
	* src/version_usage.cc
	* test/StringFormatTest.cc
	* src/*.h: The classes that has const Logger* as a member variable.
2008-04-26 05:58:49 +00:00
Tatsuhiro Tsujikawa 2a81fd466d 2008-04-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added build-in "Accept-Feature" support. For now only "metalink" is
	used in this header field.
	This "metalink" value is removed from the list when connecting URLs
	fed by metalink file to avoid loop in "transparent" metlaink.
	* src/HttpRequest.cc
	* src/HttpRequest.h: Renamed _userHeaders as _headers. Accept-Feature
	header is also held in this variable. Also renamed setUserHeaders as
	addHeader and it was rewritten to add header not just to clear the old
	value.
	* src/HttpRequestCommand.cc
	* src/Metalink2RequestGroup.cc: Added the code to remove "metalink"
	from "Accept-Feature" list.
	* src/RequestGroup.cc: Added "metalink" to "Accept-Feature" by default.
	* src/RequestGroup.h
	* src/TaggedItem.cc: Moved Concat class to a2functional.h.
	* src/a2functional.h: Included <string> because Concat class depends on
	it.
	* test/HttpRequestTest.cc
2008-04-25 17:44:03 +00:00
Tatsuhiro Tsujikawa 1c7c6f9898 2008-04-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Rewritten HTTP keep-alive and pipelining routine.
	* src/AbstractCommand.cc
	* src/HttpConnection.cc
	* src/HttpDownloadCommand.cc
	* src/HttpRequest.cc
	* src/HttpRequestCommand.cc
	* src/HttpResponseCommand.cc
	* src/Request.cc
	* src/Request.h
	* src/RequestGroup.cc
	* test/HttpRequestTest.cc
	* test/HttpResponseTest.cc
	* test/RequestTest.cc
2008-04-22 07:15:35 +00:00
Tatsuhiro Tsujikawa e1fa62e6c7 2008-04-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Now HTTP status and version are a member variable of HttpHeader.
	HTTP status is processed as a string, not integer.
	* src/AbstractProxyResponseCommand.cc
	* src/HttpConnection.cc
	* src/HttpHeader.cc
	* src/HttpHeader.h
	* src/HttpHeaderProcessor.cc
	* src/HttpHeaderProcessor.h
	* src/HttpResponse.cc
	* src/HttpResponse.h
	* test/HttpHeaderProcessorTest.cc
	* test/HttpResponseTest.cc
2008-04-21 10:48:11 +00:00
Tatsuhiro Tsujikawa 3eb74629cb 2008-04-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added --header option. You can specify any number of additional 
HTTP headers
	like:
	aria2 --header="X-A: 300" --header="X-B: 900" http://host/file
	Unlike other commad-line option, you can use --header option 
multiple times.
	* src/HelpItemFactory.cc
	* src/HttpRequest.{cc, h}
	* src/HttpRequestCommand.cc
	* src/OptionHandlerFactory.cc
	* src/OptionHandlerImpl.h
	* src/option_processing.cc
	* src/prefs.h
	* src/usage_text.h
	* test/HttpRequestTest.cc (testUserHeaders)
2008-04-20 06:30:44 +00:00
Tatsuhiro Tsujikawa 3505201f33 2008-04-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Rewritten SharedHandle. Now copy constructor taking raw pointer 
has
	keyword explicit and SharedHandle's default constructor 
initializes
	its internal obj to null, old implementation initializes it 
using
	obj's default constructor.
	To assign null, write SharedHandle<T> x(...); x.reset();
	TODO: test/SharedHandleTest.cc needs more tests.
	* src/SharedHandle.h
2008-04-20 00:50:22 +00:00
Tatsuhiro Tsujikawa 9217319fc6 Added ProtocolDetectorTest to Makefile 2008-04-13 13:37:44 +00:00
Tatsuhiro Tsujikawa 846e7c70f5 2008-04-13 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Implemented auto protocol detection.
	Now you can do:
	aria2c -Z http://host/file file1.torrent file2.metalink
	(Note: -Z option is required for auto protcol detection.)
	Then aria2c downloads 3 files simultaneously:
	1. http://host/file
	2. file1.torrent <-- read local torrent file
	3. file2.metalink <-- read local Metalink file.

	Same thing goes with -i option. Assume your uris.txt contans:
	http://host/file
	file1.torrent
	file2.metalink
	Then you can do: aria2c -i uris.txt
	(Note: -Z option is not needed if -i option is given.)
	
	* src/main.cc
	* src/ProtocolDetector.{cc, h}
	* test/ProtocolDetectorTest.cc
2008-04-13 13:30:12 +00:00
Tatsuhiro Tsujikawa d13c416a94 2008-04-13 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Rewritten choking algorithm.
	* src/PeerChokeCommand.{cc, h}
	* src/BtInterestedMessage.cc
	* src/PeerSessionResource.{cc, h}
	* src/DefaultPeerStorage.{cc, h}
	* src/BtNotInterestedMessage.cc
	* src/DefaultBtMessageDispatcher.{cc, h}
	* src/BtMessageDispatcher.h
	* src/Peer.{cc, h}
	* src/BtLeecherStateChoke.{cc, h}
	* src/BtSetup.cc
	* src/BtSeederStateChoke.{cc, h}
	* src/PeerStorage.h
	* test/MockPeerStorage.h
	* test/MockBtMessageDispatcher.h
2008-04-13 01:25:36 +00:00
Tatsuhiro Tsujikawa d034c4d773 2008-03-16 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Rewritten getBasename() and getDirname(), without standard 
library
	basename(), dirname().
	* src/File.cc
	* test/FileTest.cc
2008-03-16 09:04:21 +00:00
Tatsuhiro Tsujikawa 42fa16b780 2008-03-15 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Suppress content-range error when 'Content-Range' response header
	doesn't contains bytes-unit specifier 'bytes'
	* src/HttpHeader.cc (getRange)
	* test/HttpHeaderTest.cc
2008-03-15 04:25:55 +00:00