From 4708809094a67fd75276aed2794f14274f1122e6 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 20 Feb 2008 12:33:16 +0000 Subject: [PATCH] 2008-02-20 Tatsuhiro Tsujikawa Change the unit of --stop option from a minute to a second. * src/usage_text.h * src/DownloadEngineFactory.cc * src/OptionHandlerFactory.cc * src/message.h * src/TimedHaltCommand.cc --- ChangeLog | 9 +++++++++ src/DownloadEngineFactory.cc | 6 +++--- src/OptionHandlerFactory.cc | 2 +- src/TimedHaltCommand.cc | 2 +- src/message.h | 2 +- src/usage_text.h | 2 +- 6 files changed, 16 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index a8a117fa..f3220a18 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-02-20 Tatsuhiro Tsujikawa + + Change the unit of --stop option from a minute to a second. + * src/usage_text.h + * src/DownloadEngineFactory.cc + * src/OptionHandlerFactory.cc + * src/message.h + * src/TimedHaltCommand.cc + 2008-02-19 Tatsuhiro Tsujikawa Make listening socket non-block mode. diff --git a/src/DownloadEngineFactory.cc b/src/DownloadEngineFactory.cc index 308ebc6f..fc74fbd5 100644 --- a/src/DownloadEngineFactory.cc +++ b/src/DownloadEngineFactory.cc @@ -88,9 +88,9 @@ DownloadEngineFactory::newDownloadEngine(Option* op, e->commands.push_back(new AutoSaveCommand(CUIDCounterSingletonHolder::instance()->newID(), e.get(), op->getAsInt(PREF_AUTO_SAVE_INTERVAL))); e->commands.push_back(new HaveEraseCommand(CUIDCounterSingletonHolder::instance()->newID(), e.get(), 10)); { - int32_t stopMin = op->getAsInt(PREF_STOP); - if(stopMin > 0) { - e->commands.push_back(new TimedHaltCommand(CUIDCounterSingletonHolder::instance()->newID(), e.get(), stopMin*60)); + int32_t stopSec = op->getAsInt(PREF_STOP); + if(stopSec > 0) { + e->commands.push_back(new TimedHaltCommand(CUIDCounterSingletonHolder::instance()->newID(), e.get(), stopSec)); } } return e; diff --git a/src/OptionHandlerFactory.cc b/src/OptionHandlerFactory.cc index f01fbf3c..80e9fd83 100644 --- a/src/OptionHandlerFactory.cc +++ b/src/OptionHandlerFactory.cc @@ -118,7 +118,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers() handlers.push_back(new HostPortOptionHandler(PREF_DHT_ENTRY_POINT, PREF_DHT_ENTRY_POINT_HOST, PREF_DHT_ENTRY_POINT_PORT)); - handlers.push_back(new NumberOptionHandler(PREF_STOP, 0, 35000000)); + handlers.push_back(new NumberOptionHandler(PREF_STOP, 0, INT32_MAX)); handlers.push_back(new ParameterOptionHandler(PREF_BT_MIN_CRYPTO_LEVEL, V_PLAIN, V_ARC4)); handlers.push_back(new BooleanOptionHandler(PREF_BT_REQUIRE_CRYPTO)); diff --git a/src/TimedHaltCommand.cc b/src/TimedHaltCommand.cc index 54db6cfe..75ac3b67 100644 --- a/src/TimedHaltCommand.cc +++ b/src/TimedHaltCommand.cc @@ -56,7 +56,7 @@ void TimedHaltCommand::preProcess() void TimedHaltCommand::process() { if(!_e->isHaltRequested()) { - logger->notice(MSG_TIME_HAS_PASSED, _interval/60); + logger->notice(MSG_TIME_HAS_PASSED, _interval); _e->requestHalt(); } } diff --git a/src/message.h b/src/message.h index 330c116b..da262ca1 100644 --- a/src/message.h +++ b/src/message.h @@ -139,7 +139,7 @@ #define MSG_SOMETHING_MISSING_IN_TORRENT _("Missing %s in torrent metainfo.") #define MSG_NULL_TRACKER_RESPONSE _("Tracker returned null data.") #define MSG_WINSOCK_INIT_FAILD _("Windows socket library initialization failed") -#define MSG_TIME_HAS_PASSED _("%d minute(s) has passed. Stopping application.") +#define MSG_TIME_HAS_PASSED _("%d second(s) has passed. Stopping application.") #define EX_TIME_OUT _("Timeout.") #define EX_INVALID_CHUNK_SIZE _("Invalid chunk size.") diff --git a/src/usage_text.h b/src/usage_text.h index 1bcf4696..062ed5cb 100644 --- a/src/usage_text.h +++ b/src/usage_text.h @@ -328,5 +328,5 @@ _(" --no-conf Disable loading aria2.conf file.") #define TEXT_CONF_PATH \ _(" --conf-path=PATH Change the configuration file path to PATH.") #define TEXT_STOP \ -_(" --stop=MINUTES Stop application after MINUTES minutes has passed.\n" \ +_(" --stop=SEC Stop application after SEC seconds has passed.\n" \ " If 0 is given, this feature is disabled.")