summaryrefslogtreecommitdiff
path: root/src/Option.h
Commit message (Collapse)AuthorAgeFilesLines
* Restart active download to apply previously not applicable optionsTatsuhiro Tsujikawa2016-05-061-0/+2
| | | | | | | | | | | | | | | Previously, we categorized options that can be used in aria2.changeOption RPC method into 2 categories. The options in one category can be applied on the fly, meaning that download continues to be active while applying options. Another category includes options which are only applicable when downloads are waiting or paused. In this change, when active download is ordered to change options which only applicable in waiting or paused state, it is now paused, and then automatically restarted. Although we have limited number of download concurrency, the pause and restart is done atomically, and the download is inserted at the front of the queue, it is picked up immediately if the concurrency regulation allows.
* make clang-format using clang-format-3.6Tatsuhiro Tsujikawa2015-12-271-4/+2
|
* Disable --deferred-input when --save-session is used togetherTatsuhiro Tsujikawa2015-11-281-0/+2
| | | | | | | | | | | | With --deferred-input=true, aria2 only reads input file to fill active download slots, while keeping input file open. Meanwhile, --save-session saves all download info inside memory, but this does not take into account of unread item in input file. This will lead to lose input data in saved session file. Also current BufferedFile implementation used to read/write input/output file take a lock on Windows. This effectively prevents session serializer from writing session data to the same file which is still kept open because of --deferred-input. See GH-493
* Include prefs.h instead of typedef PrefPtr everywhereTatsuhiro Tsujikawa2013-09-261-3/+2
|
* Introduce PrefPtr typedefNils Maier2013-09-191-10/+11
|
* Require -std=c++11 and use std::shared_ptr instead of SharedHandleTatsuhiro Tsujikawa2013-06-221-5/+4
|
* Save options directly specified for download in --save-sessionTatsuhiro Tsujikawa2013-04-111-7/+22
| | | | | | | This change makes --save-session save only options specified for download, more specifically, options in command-line, -i file and via RPC. The other options from conf file and default values are not saved. This will drastically decrease the size of session file.
* Removed trailing spacesTatsuhiro Tsujikawa2012-10-011-1/+1
|
* Fixed clang warning and errors.Tatsuhiro Tsujikawa2012-03-011-1/+1
| | | | | | Test for the zero-length array with A2_ARRAY_LEN was commented out since it is only used in unit test code and clang and old gcc 3.4.3 emit error.
* Added const to Option::getTable()Tatsuhiro Tsujikawa2011-12-011-1/+1
|
* OptionHandler now knows its option can be used in -i list option,Tatsuhiro Tsujikawa2011-10-221-0/+3
| | | | | | changeable in aria2.changeOption or aria2.changeGlobalOption. OptionHandler also now its option is cumulative.
* Rewritten Option. Introduced Pref.Tatsuhiro Tsujikawa2011-10-211-18/+21
| | | | | Now preference key is Pref instead of just string. It has Option ID. Now option lookup and setting takes O(1) using Pref object.
* In MinGW32, open file with UNICODE filename and print them in ANSI.Tatsuhiro Tsujikawa2011-08-041-0/+4
|
* 2010-11-14 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-11-141-8/+2
| | | | | | | | | 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-10-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-10-311-3/+3
| | | | | | Made #include guard consistent for c++ header files.
* 2010-06-21 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-06-211-3/+3
| | | | | | | Changed naming standards for class member variable: now it looks like var_ instead of _var.
* 2010-06-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-06-121-3/+3
| | | | | | | | Renamed member variables. * src/Option.cc * src/Option.h
* 2010-01-06 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2010-01-051-1/+1
| | | | | | | | | Untabify. Fixed one line in copyright which is longer than 80 columns. * src * test
* 2009-12-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2009-12-201-0/+10
| | | | | | | | | | | | | | | Added getOption and getGlobalOption XML-RPC method. getOption takes GID as a parameter and returns its options as struct. getGlobalOption takes no parameter and returns global options. Because global option is used as a template for the option of newly added downloads, it includes options returned by getOption. * src/Option.h * src/XmlRpcMethodFactory.cc * src/XmlRpcMethodImpl.cc * src/XmlRpcMethodImpl.h
* 2009-11-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2009-11-281-0/+2
| | | | | | | | Added remove(). * src/Option.cc * src/Option.h
* 2008-12-04 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>Tatsuhiro Tsujikawa2008-12-041-0/+5
| | | | | | | | | | | | | | Added Option::blank(). Use !Option::blank(name) instead of Option::defined(name) for the options that take filename. * src/MultiUrlRequestInfo.cc * src/Option.cc * src/Option.h * src/main.cc * src/option_processing.cc * test/OptionTest.cc
* 2008-10-04 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-10-041-1/+1
| | | | | | | Made getAsInt() return int32_t * src/Option.h
* 2008-05-18 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-05-181-1/+1
| | | | | | | | Made Option::get(...) return const reference of std::string. * src/Option.cc * src/Option.h
* 2008-03-09 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-03-091-1/+1
| | | | | | type cleanup for allmost all remaining files.
* 2008-02-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2008-02-081-9/+11
| | | | | | | | | Removed "using namespace std;" from all sources. Appended std:: prefix to c++ standard classes. Included string.h where mem* function are used.
* 2007-07-21 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-07-211-2/+2
| | | | | | | Converted int's to in32_t. long long int's are also converted to int64_t
* 2007-03-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2007-03-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* 2006-09-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2006-09-211-2/+15
| | | | | | | | * src/*.{h,cc}: Added an exception to the license which allows linking with OpenSSL.
* 2006-08-27 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2006-08-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To add --seed-time and --seed-ratio command-line option: * src/Option.h (getAsDouble): New function. * src/Option.cc (getAsDouble): New function. * src/SeedCheckCommand.h: New class. * src/SeedCheckCommand.cc: New class. * src/DownloadEngineFactory.cc (SeedCheckCommand.h): Included. (UnionSeedCriteria.h): Included. (TimeSeedCriteria.h): Included. (ShareRatioSeedCriteria.h): Included. (newTorrentConsoleEngine): Added the processing of seed option. * src/SeedCriteria.h: New class. * src/ShareRatioSeedCriteria.h: New class. * src/TimeSeedCriteria.h: New class. * src/UnionSeedCriteria.h: New class. * src/prefs.h (PREF_SEED_TIME): New definition. (PREF_SEED_RATIO): New definition. * src/main.cc (showUsage): Added --seed-time and --seed-ratio option. (main): Added --seed-time and --seed-ratio option. Made default log file name "/dev/null". * src/SharedHandle.h (SharedHandle): Copy constructor. Made it assignable from the SharedHandle of the subclasses. (operator=): Made it assignable from the SharedHandle of the subclasses. (getRefCount): New function. To add notice log level and the switch to write log to stdout. This switch is configurable per log level. * src/Logger.h (notice): New function. (LEVEL): Added NOTICE. Assigned an explicit value to each log level constant. * src/LogFactory.cc (getInstance): The use of NullLogger was removed. A log message with notice log level was made written to stdout along with log file. * src/NullLogger.h (notice): New function. * src/SimpleLogger.h (writeHeader): Added the 'file' argument. (writeLog): Added the 'file' argument. (writeFile): New function. (stdoutField): New variable. (SimpleLogger): Removed the default constructor. (SimpleLogger): Made the default value of logfile 0. (debug): Added 'virtual' keyword. (info): Added 'virtual' keyword. (warn): Added 'virtual' keyword. (error): Added 'virtual' keyword. (notice): New function. (setStdout): New function. * src/SimpleLogger.cc (WRITE_LOG): Replaced writeLog with writeFile. (WRITE_LOG_EX): Replaced writeLog with writeFile. (SimpleLogger): Removed the default constructor. (setStdout): New function. (writeLog): Added the handling of NOTICE log level. (writeFile): New function. (notice): New function. * src/TorrentMan.h: Updated doc. * src/BitfieldMan.h: Updated doc. * src/TrackerWatcherCommand.cc (execute): Return true if error occurred in the request to the tracker and halt is requested. * src/TrackerUpdateCommand.cc (execute): Return true if error occurred in the request to the tracker and halt is requested. * src/TorrentConsoleDownloadEngine.h (onSelectiveDownloadingCompletes): Removed. * src/TorrentConsoleDownloadEngine.cc (onSelectiveDownloadingCompletes): Removed. * src/TorrentDownloadEngine.h (onEndOfRun): Added 'virtual' keyword. (afterEachIteration): Removed. (onSelectiveDownloadingCompletes): Removed. * src/TorrentDownloadEngine.cc (onEndOfRun): Removed filenameFixed. (afterEachIteration): Removed. * src/TorrentMan.cc (completePiece): Call onDownloadComplete here. (onDownloadComplete): Added 2 log messages.
* 2006-08-03 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>Tatsuhiro Tsujikawa2006-08-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/Option.h (getAsBool): New function. * src/Option.cc (prefs.h): Included. (defined): 0-length value is now recognized as undefined. (getAsInt): Rewritten. (getAsLLInt): Rewritten. (getAsBool): New function. * src/FeatureConfig.h: Rewritten. * src/FeatureConfig.cc: Rewritten. * src/prefs.h (PREF_STDOUT_LOG): New definition. (PREF_LOG): New definition. (PREF_DIR): New definition. (PREF_OUT): New definition. (PREF_SPLIT): New definition. (PREF_DAEMON): New definition. (PREF_REFERER): New definition. (PREF_TORRENT_FILE): New definition. (PREF_LISTEN_PORT): New definition. (PREF_METALINK_FILE): New definition. (PREF_METALINK_VERSION): New definition. (PREF_METALINK_LANGUAGE): New definition. (PREF_METALINK_OS): New definition. (PREF_METALINK_SERVERS): New definition. * src/main.cc (main): Following command-line parameters are now put into Option class: stdoutLog, logfile, dir, ufilename, split, daemonMode, referer, torrentFile, metalinkFile, listenPort, metalinkVersion, metalinkLanguage, metalinkOs, metalinkServers To fix the bug that aria2 can not handle http response header properly. * src/HttpHeader.cc (put): Made name lowercased. (defined): Made name lowercased. (getFirst): Made name lowercased. (get): Made name lowercased. (getFirstAsInt): Rewritten. (getFirstAsLLInt): Rewritten.
* * Util.{h,cc}: added startsWith().Tatsuhiro Tsujikawa2006-02-281-0/+1
| | | | | | | | | | | | | | | | | | * CookieBox.cc: rewrited criteriaFind() using Util::startsWith() and Util::endsWith(). * SocketCore.cc: struct addrinfo is now zero-initialized. * common.h: added #include directive of limit.h. * DownloadEngine.cc: added #include directive of sys/time.h and algorithm. * Exception.h: added #include directive of stdio.h. * AbstractCommand.h: added #include directive of sys/time.h. * DownloadCommand.h: added #include directive of sys/time.h. * *.h: added #include directive of common.h to all base classes. subclasses' one was removed.
* (no commit message)Tatsuhiro Tsujikawa2006-02-221-0/+1
|
* Initial importTatsuhiro Tsujikawa2006-02-171-0/+43