Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Peer ID for PicoTorrent #285

Merged
merged 1 commit into from
May 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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