]> git.pld-linux.org Git - packages/libtorrent.git/blob - libtorrent-client_list.patch
- release 4 (by relup.sh)
[packages/libtorrent.git] / libtorrent-client_list.patch
1 --- libtorrent-0.12.3/src/torrent/peer/client_list.cc.orig      2008-05-07 14:19:13.000000000 +0200
2 +++ libtorrent-0.12.3/src/torrent/peer/client_list.cc   2008-10-26 19:22:03.380552372 +0100
3 @@ -73,8 +73,10 @@
4    insert_helper(ClientInfo::TYPE_AZUREUS, "BX", NULL, NULL, "Bittorrent X");
5    insert_helper(ClientInfo::TYPE_AZUREUS, "BS", NULL, NULL, "BTSlave");
6    insert_helper(ClientInfo::TYPE_AZUREUS, "CT", NULL, NULL, "CTorrent");
7 -  insert_helper(ClientInfo::TYPE_AZUREUS, "DE", NULL, NULL, "DelugeTorrent");
8 +  insert_helper(ClientInfo::TYPE_AZUREUS, "DE", NULL, NULL, "Deluge");
9    insert_helper(ClientInfo::TYPE_AZUREUS, "ES", NULL, NULL, "Electric Sheep");
10 +  insert_helper(ClientInfo::TYPE_AZUREUS, "FG", NULL, NULL, "FlashGet");
11 +  insert_helper(ClientInfo::TYPE_AZUREUS, "LW", NULL, NULL, "LimeWire");
12    insert_helper(ClientInfo::TYPE_AZUREUS, "LP", NULL, NULL, "Lphant");
13    insert_helper(ClientInfo::TYPE_AZUREUS, "MT", NULL, NULL, "MoonlightTorrent");
14    insert_helper(ClientInfo::TYPE_AZUREUS, "MP", NULL, NULL, "MooPolice");
15 @@ -84,13 +86,13 @@
16    insert_helper(ClientInfo::TYPE_AZUREUS, "SS", NULL, NULL, "SwarmScope");
17    insert_helper(ClientInfo::TYPE_AZUREUS, "SB", NULL, NULL, "Swiftbit");
18    insert_helper(ClientInfo::TYPE_AZUREUS, "TN", NULL, NULL, "TorrentDotNET");
19 -  insert_helper(ClientInfo::TYPE_AZUREUS, "TS", NULL, NULL, "Torrentstorm");
20    insert_helper(ClientInfo::TYPE_AZUREUS, "TR", NULL, NULL, "Transmission");
21 -  insert_helper(ClientInfo::TYPE_AZUREUS, "XT", NULL, NULL, "XanTorrent");
22 -  insert_helper(ClientInfo::TYPE_AZUREUS, "ZT", NULL, NULL, "ZipTorrent");
23 +  insert_helper(ClientInfo::TYPE_AZUREUS, "TS", NULL, NULL, "TorrentStorm");
24 +  insert_helper(ClientInfo::TYPE_AZUREUS, "XL", NULL, NULL, "Xunlei");
25 +  insert_helper(ClientInfo::TYPE_AZUREUS, "XX", NULL, NULL, "Xtorrent");
26  
27    insert_helper(ClientInfo::TYPE_COMPACT, "A", NULL, NULL, "ABC");
28 -  insert_helper(ClientInfo::TYPE_COMPACT, "S", NULL, NULL, "Shadow's client");
29 +  insert_helper(ClientInfo::TYPE_COMPACT, "S", NULL, NULL, "Shadow's");
30    insert_helper(ClientInfo::TYPE_COMPACT, "U", NULL, NULL, "UPnP NAT BitTorrent");
31    insert_helper(ClientInfo::TYPE_COMPACT, "O", NULL, NULL, "Osprey Permaseed");
32  
33 @@ -100,10 +102,14 @@
34    insert_helper(ClientInfo::TYPE_AZUREUS, "BG", NULL, NULL, "BTG");
35    insert_helper(ClientInfo::TYPE_AZUREUS, "BR", NULL, NULL, "BitRocket");
36    insert_helper(ClientInfo::TYPE_AZUREUS, "EB", NULL, NULL, "EBit");
37 +  insert_helper(ClientInfo::TYPE_AZUREUS, "FC", NULL, NULL, "FileCroc");
38    insert_helper(ClientInfo::TYPE_AZUREUS, "HL", NULL, NULL, "Halite");
39 +  insert_helper(ClientInfo::TYPE_AZUREUS, "pX", NULL, NULL, "pHoeniX");
40    insert_helper(ClientInfo::TYPE_AZUREUS, "qB", NULL, NULL, "qBittorrent");
41 +  insert_helper(ClientInfo::TYPE_AZUREUS, "SN", NULL, NULL, "ShareNet");
42    insert_helper(ClientInfo::TYPE_AZUREUS, "UL", NULL, NULL, "uLeecher!");
43 -  insert_helper(ClientInfo::TYPE_AZUREUS, "XL", NULL, NULL, "XeiLun");
44 +  insert_helper(ClientInfo::TYPE_AZUREUS, "XT", NULL, NULL, "XanTorrent");
45 +  insert_helper(ClientInfo::TYPE_AZUREUS, "ZT", NULL, NULL, "ZipTorrent");
46  
47    insert_helper(ClientInfo::TYPE_COMPACT, "R", NULL, NULL, "Tribler");
48  }
49 @@ -169,6 +175,13 @@
50        std::isxdigit(id[3]) && std::isxdigit(id[4]) && std::isxdigit(id[5]) && std::isxdigit(id[6])) {
51      dest->set_type(ClientInfo::TYPE_AZUREUS);
52  
53 +    // incoming connection with spoofed id
54 +    if (id[1] == 'l' && id[2] == 't' && !std::strncmp(id.c_str()+16, "UDP0", 4)) {
55 +      *dest = *begin();
56 +      std::memset(dest->mutable_upper_version(), 0, ClientInfo::max_version_size);
57 +      return false;
58 +    }
59 +
60      dest->mutable_key()[0] = id[1];
61      dest->mutable_key()[1] = id[2];
62      
63 @@ -176,15 +189,22 @@
64        dest->mutable_version()[i] = dest->mutable_upper_version()[i] = rak::hexchar_to_value(id[3 + i]);
65  
66    } else if (std::isalpha(id[0]) && id[4] == '-' &&
67 -             std::isxdigit(id[1]) && std::isxdigit(id[2]) && std::isxdigit(id[3])) {
68 +             std::isxdigit(id[1]) && std::isxdigit(id[2]) && std::isalnum(id[3])) {
69      dest->set_type(ClientInfo::TYPE_COMPACT);
70  
71      dest->mutable_key()[0] = id[0];
72      dest->mutable_key()[1] = '\0';
73      
74 +    // T03G = BitTornado 0.3.16
75 +    char id3;
76 +    if (id[3] > 'F' && id[3] < 'a')
77 +      id3 = id[3] - 'F' + 0xF;
78 +    else
79 +      id3 = rak::hexchar_to_value(id[3]);
80 +
81      dest->mutable_version()[0] = dest->mutable_upper_version()[0] = rak::hexchar_to_value(id[1]);
82      dest->mutable_version()[1] = dest->mutable_upper_version()[1] = rak::hexchar_to_value(id[2]);
83 -    dest->mutable_version()[2] = dest->mutable_upper_version()[2] = rak::hexchar_to_value(id[3]);
84 +    dest->mutable_version()[2] = dest->mutable_upper_version()[2] = id3;
85      dest->mutable_version()[3] = dest->mutable_upper_version()[3] = '\0';
86  
87    } else if (std::isalpha(id[0]) && std::isdigit(id[1]) && id[2] == '-' &&
This page took 0.107951 seconds and 3 git commands to generate.