Commit Graph

25 Commits (62a07fff5fea3e681916e1ff521c60eef2a65136)

Author SHA1 Message Date
Tatsuhiro Tsujikawa 3d767543e6 Removed OptionHandler::{get,set}OptionID() and canHandle().
Removed typedefs in OptionHandler and NameMatchOptionHandler.
2011-10-22 22:52:23 +09:00
Tatsuhiro Tsujikawa d5c8d048ef Rewritten OptionParser. Made it simpler and efficient. 2011-10-22 01:03:14 +09:00
Tatsuhiro Tsujikawa 3832ed97c6 Rewritten Option. Introduced Pref.
Now preference key is Pref instead of just string.  It has Option
ID. Now option lookup and setting takes O(1) using Pref object.
2011-10-21 21:56:42 +09:00
Tatsuhiro Tsujikawa fc4d38d236 Rewritten HttpProxyOptionHandler using uri::parse().
Removed test case where username is empty and resulted URI has empty
username in URI.
2011-10-18 00:40:43 +09:00
Tatsuhiro Tsujikawa dbf4f553ca Deprecated --enable-direct-io option.
Modified DeprecatedOptionHandler so that it can have replacing
OptionHandler.
2011-07-16 16:03:28 +09:00
Tatsuhiro Tsujikawa 63c84509b9 2010-11-25 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed unittest error
	* test/OptionHandlerTest.cc
2010-11-25 12:14:17 +00:00
Tatsuhiro Tsujikawa 06cd151c4b 2010-11-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Cleaned up Possible Values in usage help.  More than 2 values are
	delimited by ", ".
	* src/NameMatchOptionHandler.h
	* src/OptionHandler.cc
	* src/OptionHandler.h
	* src/OptionHandlerFactory.cc
	* src/OptionHandlerImpl.cc
	* test/OptionHandlerTest.cc
2010-11-23 14:47:58 +00:00
Tatsuhiro Tsujikawa 1372ac51ad 2010-11-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added .cc file for classes/structs that only provided by header
	file. Defined non-POD classes' ctor, dtor in .cc file.  Moved
	implementation code in header file to .cc file for major
	classes/strucsts.
2010-11-14 07:17:55 +00:00
Tatsuhiro Tsujikawa 9eaf3ccb0f 2010-09-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Replaced V_TRUE with A2_V_TRUE. Replaced V_FALSE with A2_V_FALSE.
	* src/AbstractCommand.cc
	* src/HttpResponseCommand.cc
	* src/Option.cc
	* src/OptionHandlerFactory.cc
	* src/OptionHandlerImpl.h
	* src/TrackerWatcherCommand.cc
	* src/download_helper.cc
	* src/main.cc
	* src/prefs.cc
	* src/prefs.h
	* test/AuthConfigFactoryTest.cc
	* test/DefaultBtProgressInfoFileTest.cc
	* test/DownloadHelperTest.cc
	* test/HttpRequestTest.cc
	* test/OptionHandlerTest.cc
	* test/UTMetadataPostDownloadHandlerTest.cc
	* test/XmlRpcMethodTest.cc
2010-09-11 12:48:03 +00:00
Tatsuhiro Tsujikawa ca2b33c3da 2010-03-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Resurrected --http-proxy-user and --http-proxy-passwd option.
	Added --https-proxy-user, --https-proxy-passwd, --ftp-proxy-user,
	--ftp-proxy-passwd, --all-proxy-user, --all-proxy-passwd option.
	* doc/aria2c.1.txt
	* src/OptionHandlerFactory.cc
	* src/OptionHandlerImpl.h
	* src/prefs.cc
	* src/prefs.h
	* src/usage_text.h
	* test/OptionHandlerTest.cc
2010-03-11 15:09:34 +00:00
Tatsuhiro Tsujikawa c342bde962 2010-02-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use vector instead of deque for containers which is used for
	mostly read-only purpose.
2010-02-28 12:30:11 +00:00
Tatsuhiro Tsujikawa b5ee1b5071 2010-01-17 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Rewritten toTagString
	* src/NameMatchOptionHandler.cc
	* test/OptionHandlerTest.cc
2010-01-17 13:58:42 +00:00
Tatsuhiro Tsujikawa c022939c8f 2010-01-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Now --all-proxy, --http-proxy, --https-proxy and --ftp-proxy
	option accepts empty string "".  When "" is given, it erases
	previously defined proxy.
	* doc/aria2c.1.txt
	* src/OptionHandlerImpl.h
	* src/usage_text.h
	* test/OptionHandlerTest.cc
2010-01-15 09:04:47 +00:00
Tatsuhiro Tsujikawa 4db349c1f3 2010-01-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Untabify. Fixed one line in copyright which is longer than 80
	columns.
	* src
	* test
2010-01-05 16:01:46 +00:00
Tatsuhiro Tsujikawa 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 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 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 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 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 1b7c198289 2008-02-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Removed "using namespace std;" from all sources. Appended std:: 
prefix to c++
	standard classes.
	Included string.h where mem* function are used.
2008-02-08 15:53:45 +00:00
Tatsuhiro Tsujikawa 0f13363229 2008-02-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added DHT functionality, compatible with mainline.
	DHT is disabled by default. To enable it, give --enable-dht to 
aria2c.
	You may need to specify entry point to DHT network using
	--dht-entry-point. DHT uses UDP port to listen incoming message.
	Use --dht-listen-port to specify port number. Make sure that 
your
	firewall configuration can pass through UDP traffic to the port.
	The routing table is saved in $HOME/.aria2/dht.dat.
	* src/DHT*
	* src/BNode.{h, cc}
	* src/PeerInteractionCommand.cc: enable DHT functionality for a
	particular torrent.
	* src/Data.cc: Rewritten ctor.
	* src/OptionHandlerFactory.cc: Added --enable-dht, 
--dht-listen-port,
	--dht-entry-point.
	* src/DefaultBtInteractive.cc: Send port message if dht is 
enabled.
	* src/RequestGroup.cc: Initialize DHT functionality. When 
download
	ends, remove BtContext from DHTPeerAnnounceStorage.
	* src/BtPortMessage.{h, cc}: Rewritten.
	* src/message.h
	* src/OptionHandlerImpl.cc
	* src/option_processing.cc: Added --enable-dht, 
--dht-listen-port,
	--dht-entry-point.
	* src/Dictionary.{h, cc} (remove): New function.
	* src/prefs.h
	* src/DefaultBtMessageFactory.h
	* src/BtHandshakeMessage.cc
	* src/ActivePeerConnectionCommand.cc
	* src/SocketCore.{h, cc}: Added datagram socket support.
	* src/DefaultBtMessageFactory.cc
	* src/BtSetup.cc: Add BtContext to DHTPeerAnnounceStorage here.
	Create DHT commands.
	* src/BtMessageFactory.h
	* src/PeerMessageUtil.{h, cc}
2008-02-01 17:36:33 +00:00
Tatsuhiro Tsujikawa 7436490f75 2007-11-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Replaced strtol with Util::parseInt
	* src/ChunkedEncoding.cc
	* src/HttpConnection.cc
	* src/CookieBoxFactory.cc
	* src/ParameterizedStringParser.cc
	* src/Util.cc
	* test/UtilTest.cc
	* test/OptionHandlerTest.cc
	* src/Request.cc

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

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

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

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

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

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

	Added IntegerRangeOptionHandler. Used for --listen-port and
	--select-file. Now --listen-port accepts range of port.
	* src/OptionHandlerFactory.cc
	* src/version_usage.cc
	* src/OptionHandlerImpl.h
	* src/option_processing.cc
	* src/BtSetup.cc
	* src/PeerListenCommand.{h, cc}
	* doc/aria2c.1.txt
	* doc/aria2c.1
	
	Implemented operator< for Exception class to provide easy way to 
print
	exception stack trace.
	* src/Exception.{h, cc}
	* src/main.cc
	* src/option_processing.cc
2007-11-21 16:14:40 +00:00
Tatsuhiro Tsujikawa 729d566678 Fixed typo: threw -> thrown 2007-08-09 14:54:36 +00:00
Tatsuhiro Tsujikawa 9b73454b07 2007-03-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
To the ability to read options from a config file:
	* src/main.cc: Command-line parameter validation is delegated to
	OptionHandler class.
	* src/OptionHandlerFactory.h, src/OptionHandlerFactory.cc: New 
class.
	* src/Option.h, src/Option.cc (clear): New function.
	* src/OptionParser.h, src/OptionParser.cc: New class.
	* src/OptionHandler.h: New class.
	* src/NameMatchOptionHandler.h: New class.
	* src/OptionHandlerImpl.h: New classes.
	* src/prefs.h: '_' -> '-'
	(FTP_PASV_ENABLED): Renamed to FTP_PASV.
	(FTP_PASV): New definition.
	* src/Util.h, src/Util.cc (getRealSize): New function.
	
	To disable netrc support if .netrc file does not have correct
	permissions:
	* src/File.h, src/File.cc (mode): New function.

	To prevent confidential information to be logged:
	* src/HttpConnection.h, src/HttpConnection.cc
	(eraseConfidentialInfo): New function.
	(sendRequest): Call eraseConfidentialInfo().
	(sendProxyRequest): Call eraseConfidentialInfo().
	* src/main.cc: Validate permissions of .netrc file.
	
	To add --user-agent command-line option:
	* src/main.cc: Added new command line option: --user-agent
	* src/prefs.h (PREF_USER_AGENT): New definition.
	* src/HttpRequestCommand.cc (executeInternal): Set user-agent 
option
	parameter to HttpRequest object.
	
	Marged the patches from Dan Fandrich.
2007-03-26 12:16:57 +00:00