]> granicus.if.org Git - transmission/commitdiff
Add Peer ID for PicoTorrent
authorDhiru Kholia <dhiru.kholia@gmail.com>
Sat, 20 May 2017 11:55:15 +0000 (17:25 +0530)
committerDhiru Kholia <dhiru.kholia@gmail.com>
Sun, 21 May 2017 07:00:47 +0000 (12:30 +0530)
Based on information from https://github.com/picotorrent/picotorrent and
http://www.picotorrent.org/.

PicoTorrent uses Azureus-style peer ID: -PI-. Example: -PI0091- (major:
0, minor: 09, patch: 1).

libtransmission/clients-test.c
libtransmission/clients.c

index a7265a2d68745d701db9b62efc0cc12324045e92..c8108c773ab7a9cede01b1262557df2b0a91ed0c 100644 (file)
@@ -36,6 +36,10 @@ int main(void)
     /* Older Xfplay versions have three digit version number */
     TEST_CLIENT("-XF9990-", "Xfplay 9.9.9");
 
+    /* PicoTorrent */
+    TEST_CLIENT("-PI0091-", "PicoTorrent 0.09.1");
+    TEST_CLIENT("-PI0120-", "PicoTorrent 0.12.0");
+
     /* gobbledygook */
     TEST_CLIENT("-IIO\x10\x2D\x04-", "-IIO%10-%04-");
     TEST_CLIENT("-I\05O\x08\x03\x01-", "-I%05O%08%03%01-");
index 12cee8675ecd0a7181c54d5556957395136deaea..fb6125440ecd68cdb0101665fbc0500af7af425f 100644 (file)
@@ -599,6 +599,10 @@ char* tr_clientForId(char* buf, size_t buflen, void const* id_in)
                 tr_snprintf(buf, buflen, "Xfplay %d.%d.%d", strint(id + 3, 1), strint(id + 4, 1), strint(id + 5, 2));
             }
         }
+        else if (strncmp(chid + 1, "PI", 2) == 0)
+        {
+            tr_snprintf(buf, buflen, "PicoTorrent %d.%d%d.%d", charint(id[3]), charint(id[4]), charint(id[5]), charint(id[6]));
+        }
 
         if (*buf != '\0')
         {