summaryrefslogtreecommitdiff
path: root/src/OptionHandlerFactory.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2012-06-29 23:38:12 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2012-06-29 23:38:12 +0900
commit5d3b6801b1c533a5a07f24829964e589a202b62a (patch)
treeb837820bf64e1ec9344c34c04fdeb8a3e4be0640 /src/OptionHandlerFactory.cc
parent0c8ec9c325beaaaf356286ce3fe0d995a2c38fb6 (diff)
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-".
Diffstat (limited to 'src/OptionHandlerFactory.cc')
-rw-r--r--src/OptionHandlerFactory.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/OptionHandlerFactory.cc b/src/OptionHandlerFactory.cc
index 571113ea..2c329a71 100644
--- a/src/OptionHandlerFactory.cc
+++ b/src/OptionHandlerFactory.cc
@@ -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);
}