Changed default Peer ID prefix

The new Peer ID prefix is "A2-$MAJOR-$MINOR-$MICRO-", where $MAJOR,
$MINOR and $MICRO are the major version, the minor version and the
micro version respectively. For instance, 1.15.2 release of aria2 will
use "A2-1-15-2-".
pull/22/head
Tatsuhiro Tsujikawa 2012-06-29 23:38:12 +09:00
parent 0c8ec9c325
commit 5d3b6801b1
1 changed files with 5 additions and 1 deletions

View File

@ -2002,10 +2002,14 @@ OptionHandlerFactory::createOptionHandlers()
handlers.push_back(op);
}
{
int major, minor, micro;
sscanf(PACKAGE_VERSION, "%d.%d.%d", &major, &minor, &micro);
char prefix[21];
snprintf(prefix, sizeof(prefix), "A2-%d-%d-%d-", major, minor, micro);
SharedHandle<OptionHandler> op(new DefaultOptionHandler
(PREF_PEER_ID_PREFIX,
TEXT_PEER_ID_PREFIX,
"aria2/"PACKAGE_VERSION"-"));
prefix));
op->addTag(TAG_BITTORRENT);
handlers.push_back(op);
}