2008-01-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

Added --enable-peer-exchange command-line option.
	* src/OptionHandlerFactory.cc
	* src/HelpItemFactory.cc
	* src/option_processing.cc
	* src/usage_text.h
pull/1/head
Tatsuhiro Tsujikawa 2008-01-05 16:02:25 +00:00
parent e5e75ee4ed
commit eb718cfda0
5 changed files with 21 additions and 0 deletions

View File

@ -1,3 +1,11 @@
2008-01-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Added --enable-peer-exchange command-line option.
* src/OptionHandlerFactory.cc
* src/HelpItemFactory.cc
* src/option_processing.cc
* src/usage_text.h
2008-01-06 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Move extension from BtRuntime to ExtensionMessageFactory, because

View File

@ -329,6 +329,11 @@ TagContainerHandle HelpItemFactory::createHelpItems()
item->addTag(TAG_BITTORRENT);
tc->addItem(item);
}
{
HelpItemHandle item = new HelpItem(PREF_ENABLE_PEER_EXCHANGE, TEXT_ENABLE_PEER_EXCHANGE, V_TRUE);
item->addTag(TAG_BITTORRENT);
tc->addItem(item);
}
#endif // ENABLE_BITTORRENT
#ifdef ENABLE_METALINK
{

View File

@ -108,6 +108,7 @@ OptionHandlers OptionHandlerFactory::createOptionHandlers()
handlers.push_back(new ParameterOptionHandler(PREF_METALINK_PREFERRED_PROTOCOL,
Strings(&params[0], &params[arrayLength(params)])));
}
handlers.push_back(new BooleanOptionHandler(PREF_ENABLE_PEER_EXCHANGE));
return handlers;
}

View File

@ -200,6 +200,7 @@ Option* option_processing(int argc, char* const argv[])
{ "seed-ratio", required_argument, &lopt, 23 },
{ "max-upload-limit", required_argument, &lopt, 24 },
{ "peer-id-prefix", required_argument, &lopt, 25 },
{ "enable-peer-exchange", optional_argument, &lopt, 26 },
#endif // ENABLE_BITTORRENT
#ifdef ENABLE_METALINK
{ "metalink-file", required_argument, NULL, 'M' },
@ -291,6 +292,10 @@ Option* option_processing(int argc, char* const argv[])
break;
case 25:
cmdstream << PREF_PEER_ID_PREFIX << "=" << optarg << "\n";
break;
case 26:
cmdstream << PREF_ENABLE_PEER_EXCHANGE << "=" << toBoolArg(optarg) << "\n";
break;
case 100:
cmdstream << PREF_METALINK_VERSION << "=" << optarg << "\n";
break;

View File

@ -254,6 +254,8 @@ _(" --peer-id-prefix=PEERI_ID_PREFIX Specify the prefix of peer ID. The peer ID
" specified, the random alphabet characters are\n"\
" added to make it's length 20 bytes.\n"\
" Default: -aria2-")
#define TEXT_ENABLE_PEER_EXCHANGE \
_(" --enable-peer-exchange[=true|false] Enable peer exchange extension.")
#define TEXT_METALINK_FILE \
_(" -M, --metalink-file=METALINK_FILE The file path to the .metalink file.")
#define TEXT_METALINK_SERVERS \