Skip to content

Commit

Permalink
Merge pull request #285 from kholia/PicoTorrent
Browse files Browse the repository at this point in the history
Add Peer ID for PicoTorrent
  • Loading branch information
mikedld committed May 21, 2017
2 parents 4df1878 + dda33af commit c82e7ec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libtransmission/clients-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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-");
Expand Down
4 changes: 4 additions & 0 deletions libtransmission/clients.c
Original file line number Diff line number Diff line change
Expand Up @@ -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')
{
Expand Down

0 comments on commit c82e7ec

Please sign in to comment.