(trunk, libT) #5711: add support for BitTorrent client peer-id

This commit is contained in:
Jordan Lee 2014-06-07 15:07:51 +00:00
parent 28c64ae93d
commit a0fff80248
2 changed files with 8 additions and 1 deletions

View File

@ -28,6 +28,9 @@ main (void)
TEST_CLIENT ("-TR111Z-", "Transmission 1.11+");
TEST_CLIENT ("O1008132", "Osprey 1.0.0");
TEST_CLIENT ("TIX0193-", "Tixati 1.93");
TEST_CLIENT ("-UT341\0-", "\xc2\xb5Torrent 3.4.1");
TEST_CLIENT ("-BT791\0-", "BitTorrent 7.9.1");
TEST_CLIENT ("-BT791B-", "BitTorrent 7.9.1 (Beta)");
/* gobbledygook */
TEST_CLIENT ("-IIO\x10\x2D\x04-", "-IIO%10-%04-");

View File

@ -163,12 +163,16 @@ tr_clientForId (char * buf, size_t buflen, const void * id_in)
tr_snprintf (buf, buflen, "Transmission %d.%02d%s", strint (id+3,1), strint (id+4,2),
id[6]=='Z' || id[6]=='X' ? "+" : "");
}
else if (!memcmp (id+1, "UT", 2))
{
tr_snprintf (buf, buflen, "\xc2\xb5Torrent %d.%d.%d%s",
strint (id+3,1), strint (id+4,1), strint (id+5,1), getMnemonicEnd (id[6]));
}
else if (!memcmp (id+1, "BT", 2))
{
tr_snprintf (buf, buflen, "BitTorrent %d.%d.%d%s",
strint (id+3,1), strint (id+4,1), strint (id+5,1), getMnemonicEnd (id[6]));
}
else if (!memcmp (id+1, "UM", 2))
{
tr_snprintf (buf, buflen, "\xc2\xb5Torrent Mac %d.%d.%d%s",