Selaa lähdekoodia

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
Tatsuhiro Tsujikawa 18 vuotta sitten
vanhempi
commit
4708809094
6 muutettua tiedostoa jossa 16 lisäystä ja 7 poistoa
  1. 9 0
      ChangeLog
  2. 3 3
      src/DownloadEngineFactory.cc
  3. 1 1
      src/OptionHandlerFactory.cc
  4. 1 1
      src/TimedHaltCommand.cc
  5. 1 1
      src/message.h
  6. 1 1
      src/usage_text.h

+ 9 - 0
ChangeLog

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

+ 3 - 3
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;

+ 1 - 1
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));
   

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

+ 1 - 1
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.")

+ 1 - 1
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.")