From d12e69f0eb453fbf52040e436832dda040bec58f Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 10 Oct 2008 11:35:32 +0000 Subject: [PATCH] 2008-10-10 Tatsuhiro Tsujikawa Added --dht-file-path option to change the path to dht.dat, which is a serialized DHT routing table. * src/OptionHandlerFactory.cc * src/option_processing.cc * src/usage_text.h --- ChangeLog | 8 ++++++++ src/OptionHandlerFactory.cc | 6 +++--- src/option_processing.cc | 4 ++++ src/usage_text.h | 2 ++ 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index b1eeb69d..49a4378d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-10-10 Tatsuhiro Tsujikawa + + Added --dht-file-path option to change the path to dht.dat, which is a + serialized DHT routing table. + * src/OptionHandlerFactory.cc + * src/option_processing.cc + * src/usage_text.h + 2008-10-09 Tatsuhiro Tsujikawa Fixed possible underflow. diff --git a/src/OptionHandlerFactory.cc b/src/OptionHandlerFactory.cc index ae39e29a..da7238aa 100644 --- a/src/OptionHandlerFactory.cc +++ b/src/OptionHandlerFactory.cc @@ -728,10 +728,10 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers() { SharedHandle op(new DefaultOptionHandler (PREF_DHT_FILE_PATH, - NO_DESCRIPTION, + TEXT_DHT_FILE_PATH, Util::getHomeDir()+"/.aria2/dht.dat", - "/PATH/TO/DHT_DAT", - true)); + "/PATH/TO/DHT_DAT")); + op->addTag(TAG_BITTORRENT); handlers.push_back(op); } { diff --git a/src/option_processing.cc b/src/option_processing.cc index c19fec48..da1c41df 100644 --- a/src/option_processing.cc +++ b/src/option_processing.cc @@ -184,6 +184,7 @@ Option* option_processing(int argc, char* const argv[]) { PREF_BT_REQUEST_PEER_SPEED_LIMIT.c_str(), required_argument, &lopt, 32 }, { PREF_BT_MAX_OPEN_FILES.c_str(), required_argument, &lopt, 33 }, { PREF_BT_SEED_UNVERIFIED.c_str(), optional_argument, &lopt, 34 }, + { PREF_DHT_FILE_PATH.c_str(), required_argument, &lopt, 35 }, #endif // ENABLE_BITTORRENT #ifdef ENABLE_METALINK { PREF_METALINK_FILE.c_str(), required_argument, NULL, 'M' }, @@ -300,6 +301,9 @@ Option* option_processing(int argc, char* const argv[]) cmdstream << PREF_BT_SEED_UNVERIFIED << "=" << toBoolArg(optarg) << "\n"; break; + case 35: + cmdstream << PREF_DHT_FILE_PATH << "=" << optarg << "\n"; + break; case 100: cmdstream << PREF_METALINK_VERSION << "=" << optarg << "\n"; break; diff --git a/src/usage_text.h b/src/usage_text.h index f07c8ce7..a3fcd9c2 100644 --- a/src/usage_text.h +++ b/src/usage_text.h @@ -242,6 +242,8 @@ _(" --dht-listen-port=PORT... Set UDP listening port for DHT.\n"\ #define TEXT_DHT_ENTRY_POINT \ _(" --dht-entry-point=HOST:PORT Set host and port as an entry point to DHT\n"\ " network.") +#define TEXT_DHT_FILE_PATH \ +_(" --dht-file-path=PATH Change the DHT routing table file to PATH.") #define TEXT_BT_MIN_CRYPTO_LEVEL \ _(" --bt-min-crypto-level=plain|arc4 Set minimum level of encryption method.\n"\ " If several encryption methods are provided by a\n"\