2008-02-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

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
pull/1/head
Tatsuhiro Tsujikawa 2008-02-20 12:33:16 +00:00
parent 80bc9a8a21
commit 4708809094
6 changed files with 16 additions and 7 deletions

View File

@ -1,3 +1,12 @@
2008-02-20 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
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 <tujikawa at rednoah dot com>
Make listening socket non-block mode.

View File

@ -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;

View File

@ -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));

View File

@ -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();
}
}

View File

@ -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.")

View File

@ -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.")