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 Xfplay torrent client #256

Merged
merged 1 commit into from Apr 30, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions libtransmission/clients-test.c
Expand Up @@ -30,6 +30,12 @@ int main(void)
TEST_CLIENT("-BT791\0-", "BitTorrent 7.9.1");
TEST_CLIENT("-BT791B-", "BitTorrent 7.9.1 (Beta)");

/* Xfplay 9.9.92 to 9.9.94 uses "-XF9992-" */
TEST_CLIENT("-XF9992-", "Xfplay 9.9.92");

/* Older Xfplay versions have three digit version number */
TEST_CLIENT("-XF9990-", "Xfplay 9.9.9");

/* gobbledygook */
TEST_CLIENT("-IIO\x10\x2D\x04-", "-IIO%10-%04-");
TEST_CLIENT("-I\05O\x08\x03\x01-", "-I%05O%08%03%01-");
Expand Down
11 changes: 11 additions & 0 deletions libtransmission/clients.c
Expand Up @@ -587,6 +587,17 @@ char* tr_clientForId(char* buf, size_t buflen, void const* id_in)
{
tr_snprintf(buf, buflen, "MediaGet %d.%02d", charint(id[3]), charint(id[4]));
}
else if (strncmp(chid + 1, "XF", 2) == 0)
{
if (chid[6] == '0')
{
three_digits(buf, buflen, "Xfplay", id + 3);
}
else
{
tr_snprintf(buf, buflen, "Xfplay %d.%d.%d", strint(id + 3, 1), strint(id + 4, 1), strint(id + 5, 2));
}
}

if (*buf)
{
Expand Down