]> granicus.if.org Git - transmission/commitdiff
(trunk, libT) #5711: add support for BitTorrent client peer-id
authorJordan Lee <jordan@transmissionbt.com>
Sat, 7 Jun 2014 15:07:51 +0000 (15:07 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Sat, 7 Jun 2014 15:07:51 +0000 (15:07 +0000)
libtransmission/clients-test.c
libtransmission/clients.c

index 35187b93911b269ddd4866667473df9667d24b9a..53b2871f35f506d796302d16a286fe4fe2f48173 100644 (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-");
index ba60b6e0f38bd932707483e195fea8ef23fd3298..a45ee103eb7c1284329b3f4573f0f49290523683 100644 (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",