diff --git a/libtransmission/clients.c b/libtransmission/clients.c index e06d0a8fc..08e2b3b33 100644 --- a/libtransmission/clients.c +++ b/libtransmission/clients.c @@ -234,6 +234,11 @@ char* tr_clientForId(char* buf, size_t buflen, void const* id_in) tr_snprintf(buf, buflen, "\xc2\xb5Torrent Embedded %d.%d.%d%s", strint(id + 3, 1), strint(id + 4, 1), strint(id + 5, 1), getMnemonicEnd(id[6])); } + else if (strncmp(chid + 1, "UW", 2) == 0) + { + tr_snprintf(buf, buflen, "\xc2\xb5Torrent Web %d.%d.%d%s", strint(id + 3, 1), strint(id + 4, 1), strint(id + 5, + 1), getMnemonicEnd(id[6])); + } /* */ else if (strncmp(chid + 1, "AZ", 2) == 0) { @@ -291,6 +296,10 @@ char* tr_clientForId(char* buf, size_t buflen, void const* id_in) { four_digits(buf, buflen, "BitZilla", id + 3); } + else if (strncmp(chid + 1, "BI", 2) == 0) + { + four_digits(buf, buflen, "BiglyBT", id + 3); + } else if (strncmp(chid + 1, "BM", 2) == 0) { four_digits(buf, buflen, "BitMagnet", id + 3); @@ -467,6 +476,10 @@ char* tr_clientForId(char* buf, size_t buflen, void const* id_in) { four_digits(buf, buflen, "FireTorrent", id + 3); } + else if (strncmp(chid + 1, "WW", 2) == 0) + { + four_digits(buf, buflen, "WebTorrent", id + 3); + } else if (strncmp(chid + 1, "XL", 2) == 0) { four_digits(buf, buflen, "Xunlei", id + 3); @@ -500,6 +513,10 @@ char* tr_clientForId(char* buf, size_t buflen, void const* id_in) { three_digits(buf, buflen, "Electric Sheep", id + 3); } + else if (strncmp(chid + 1, "FW", 2) == 0) + { + three_digits(buf, buflen, "FrostWire", id + 3); + } else if (strncmp(chid + 1, "HL", 2) == 0) { three_digits(buf, buflen, "Halite", id + 3); @@ -622,6 +639,10 @@ char* tr_clientForId(char* buf, size_t buflen, void const* id_in) { tr_snprintf(buf, buflen, "Baidu Netdisk"); } + else if (strncmp(chid + 1, "WS", 2) == 0) + { + no_version(buf, buflen, "HTTP Seed"); + } if (!tr_str_is_empty(buf)) { @@ -647,6 +668,11 @@ char* tr_clientForId(char* buf, size_t buflen, void const* id_in) tr_snprintf(buf, buflen, "\xc2\xb5Torrent Embedded %d.%d.%d%s", strint(id + 3, 1), strint(id + 4, 1), strint(id + 5, 2), getMnemonicEnd(id[7])); } + else if (strncmp(chid + 1, "UW", 2) == 0) + { + tr_snprintf(buf, buflen, "\xc2\xb5Torrent Web %d.%d.%d%s", strint(id + 3, 1), strint(id + 4, 1), strint(id + 5, + 2), getMnemonicEnd(id[7])); + } if (!tr_str_is_empty(buf)) { @@ -788,6 +814,25 @@ char* tr_clientForId(char* buf, size_t buflen, void const* id_in) { two_major_two_minor(buf, buflen, "Tixati", id + 3); } + else if (strncmp(chid, "A2", 2) == 0) + { + if (id[4] == '-' && id[6] == '-' && id[8] == '-') + { + tr_snprintf(buf, buflen, "aria2 %c.%c.%c", id[3], id[5], id[7]); + } + else if (id[4] == '-' && id[7] == '-' && id[9] == '-') + { + tr_snprintf(buf, buflen, "aria2 %c.%c%c.%c", id[3], id[5], id[6], id[8]); + } + else + { + no_version(buf, buflen, "aria2"); + } + } + else if (strncmp(chid, "-BL", 3) == 0) + { + tr_snprintf(buf, buflen, "BitLord %c.%c.%c-%c%c%c", id[3], id[4], id[5], id[6], id[7], id[8]); + } /* Shad0w-style */ if (tr_str_is_empty(buf)) diff --git a/tests/libtransmission/clients-test.cc b/tests/libtransmission/clients-test.cc index b158aa7e1..6ab5852ae 100644 --- a/tests/libtransmission/clients-test.cc +++ b/tests/libtransmission/clients-test.cc @@ -21,7 +21,7 @@ TEST(Client, clientForId) char const* expected_client; }; - auto const tests = std::array{ + auto const tests = std::array{ LocalTest{ "-BT791B-", "BitTorrent 7.9.1 (Beta)" }, { "-BT791\0-", "BitTorrent 7.9.1" }, { "-FC1013-", "FileCroc 1.0.1.3" }, @@ -60,7 +60,16 @@ TEST(Client, clientForId) { "-I\05O\x08\x03\x01-", "-I%05O%08%03%01-" }, { "\x65\x78\x62\x63\x00\x38\x7A\x44\x63\x10\x2D\x6E\x9A\xD6\x72\x3B\x33\x9F\x35\xA9", "BitComet 0.56" }, - { "\x65\x78\x62\x63\x00\x38\x4C\x4F\x52\x44\x32\x00\x04\x8E\xCE\xD5\x7B\xD7\x10\x28", "BitLord 0.56" } + { "\x65\x78\x62\x63\x00\x38\x4C\x4F\x52\x44\x32\x00\x04\x8E\xCE\xD5\x7B\xD7\x10\x28", "BitLord 0.56" }, + + { "-UW110Q-", "\xc2\xb5Torrent Web 1.1.0" }, + { "-FW6830-", "FrostWire 6.8.3" }, + { "-BI2300-", "BiglyBT 2.3.0.0" }, + { "A2-1-18-8-", "aria2 1.18.8" }, + { "A2-1-2-0-", "aria2 1.2.0" }, + { "-BL246326", "BitLord 2.4.6-326" }, // Style used after BitLord 0.59 + { "-WW0007-", "WebTorrent 0.0.0.7" }, + { "-WS1000-", "HTTP Seed" } }; for (auto const& test : tests)