瀏覽代碼

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-".
Tatsuhiro Tsujikawa 13 年之前
父節點
當前提交
5d3b6801b1
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      src/OptionHandlerFactory.cc

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