summaryrefslogtreecommitdiff
path: root/test/OptionHandlerTest.cc
Commit message (Collapse)AuthorAgeFilesLines
* make clang-format using clang-format-3.6Tatsuhiro Tsujikawa2015-12-271-16/+44
|
* ParameterOptionHandler: Use initializer lists for paramsTatsuhiro Tsujikawa2013-06-221-42/+4
|
* Handle OptionHandlers as raw pointerTatsuhiro Tsujikawa2012-09-271-5/+4
|
* Rewritten help tags and various internal flag handling in OptionHandlerTatsuhiro Tsujikawa2012-09-231-8/+9
| | | | | Now help tags are defined as enum values to avoid vector of strings. The internal flags are represented by bitmask to shrink size.
* Proxy URI is now constructed in getProxyUri().Tatsuhiro Tsujikawa2011-11-131-87/+1
| | | | | | | | | | The previous implementation constructs proxy URI in OptionHandler but it cannot handle with the situation when user, password and proxy URI is given various order. Now we just set rules: username set in --*-proxy-user overrides username in --*-proxy option, no matter in any order username, password and proxy URI are parsed. Likewise, password set in --*--proxy-passwd overrides password in --*-proxy option.
* Removed OptionHandler::{get,set}OptionID() and canHandle().Tatsuhiro Tsujikawa2011-10-221-18/+0
| | | | Removed typedefs in OptionHandler and NameMatchOptionHandler.
* Rewritten OptionParser. Made it simpler and efficient.Tatsuhiro Tsujikawa2011-10-221-11/+0
|
* Rewritten Option. Introduced Pref.Tatsuhiro Tsujikawa2011-10-211-54/+54
| | | | | Now preference key is Pref instead of just string. It has Option ID. Now option lookup and setting takes O(1) using Pref object.
* Rewritten HttpProxyOptionHandler using uri::parse().Tatsuhiro Tsujikawa2011-10-181-11/+10
| | | | | Removed test case where username is empty and resulted URI has empty username in URI.
* Deprecated --enable-direct-io option.Tatsuhiro Tsujikawa2011-07-161-0/+22
| | | | | Modified DeprecatedOptionHandler so that it can have replacing OptionHandler.
* 2010-11-25 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-11-251-2/+2
| | | | | | | Fixed unittest error * test/OptionHandlerTest.cc
* 2010-11-23 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-11-231-1/+1
| | | | | | | | | | | | | 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-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-11-141-0/+1
| | | | | | | | | 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-09-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-09-111-4/+4
| | | | | | | | | | | | | | | | | | | | | | | 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-03-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-03-111-0/+94
| | | | | | | | | | | | | | | 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-02-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-02-281-1/+1
| | | | | | | Use vector instead of deque for containers which is used for mostly read-only purpose.
* 2010-01-17 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-01-171-1/+1
| | | | | | | | Rewritten toTagString * src/NameMatchOptionHandler.cc * test/OptionHandlerTest.cc
* 2010-01-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-01-151-0/+4
| | | | | | | | | | | | 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-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-01-051-15/+15
| | | | | | | | | Untabify. Fixed one line in copyright which is longer than 80 columns. * src * test
* 2009-08-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2009-08-301-5/+1
| | | | | | | | | | | | | | 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-02-07 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2009-02-071-92/+63
| | | | | | | | | | | | | | | | | | | | 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
* 2008-11-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-11-041-36/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-09-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-09-221-28/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-04-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-04-271-60/+40
| | | | | | | | | | | | | 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-02-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-02-081-51/+56
| | | | | | | | | Removed "using namespace std;" from all sources. Appended std:: prefix to c++ standard classes. Included string.h where mem* function are used.
* 2008-02-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-02-011-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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}
* 2007-11-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-11-221-6/+20
| | | | | | | | | | | | | | | | | | | | | 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-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-11-211-46/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fixed typo: threw -> thrownTatsuhiro Tsujikawa2007-08-091-17/+17
|
* 2007-03-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-03-261-0/+360
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.