21 |
open Md4 |
open Md4 |
22 |
open CommonTypes |
open CommonTypes |
23 |
open CommonDownloads |
open CommonDownloads |
24 |
|
open CommonStats |
25 |
open BTRate |
open BTRate |
26 |
|
|
27 |
|
|
28 |
type torrent = { |
type torrent = { |
29 |
mutable torrent_name : string; |
mutable torrent_name : string; |
30 |
mutable torrent_name_utf8 : string; |
mutable torrent_name_utf8 : string; |
90 |
| Brand_xantorrent |
| Brand_xantorrent |
91 |
| Brand_xbt |
| Brand_xbt |
92 |
| Brand_ziptorrent |
| Brand_ziptorrent |
93 |
|
| Brand_moopolice |
94 |
|
| Brand_utorrent |
95 |
|
| Brand_opera |
96 |
|
|
97 |
|
let brand_list = [ |
98 |
|
( Brand_unknown , "unknown" , "unk" ) ; |
99 |
|
( Brand_abc , "ABC" , "abc" ) ; |
100 |
|
( Brand_arctic , "Arctic" , "arc" ) ; |
101 |
|
( Brand_azureus , "Azureus" , "azu" ) ; |
102 |
|
( Brand_bitbuddy , "Bitbuddy" , "bud" ) ; |
103 |
|
( Brand_bitcomet , "BitComet" , "com" ) ; |
104 |
|
( Brand_bitkitten , "BitKitten (libTorrent)" , "kit" ) ; |
105 |
|
( Brand_bitlord , "BitLord" , "lor" ) ; |
106 |
|
( Brand_bitsonwheels , "BitsOnWheels" , "bow" ) ; |
107 |
|
( Brand_bitspirit , "BitSpirit" , "spi" ) ; |
108 |
|
( Brand_bittornado , "BitTornado" , "trn" ) ; |
109 |
|
( Brand_bittorrentx , "BitTorrent X" , "btx" ) ; |
110 |
|
( Brand_btplus , "BitTorrent Plus!" , "plu" ) ; |
111 |
|
( Brand_btslave , "BTSlave" , "sla" ) ; |
112 |
|
( Brand_btugaxp , "BTugaXP" , "uga" ) ; |
113 |
|
( Brand_burst , "Burst !" , "brs" ) ; |
114 |
|
( Brand_ctorrent , "CTorrent" , "cto" ) ; |
115 |
|
( Brand_deadmanwalking , "Deadman Walking" , "dmw" ) ; |
116 |
|
( Brand_exeem , "eXeem" , "exm" ) ; |
117 |
|
( Brand_experimental , "Experimental" , "exp" ) ; |
118 |
|
( Brand_g3torrent , "G3 Torrent" , "g3t" ) ; |
119 |
|
( Brand_libtorrent , "libTorrent" , "lib" ) ; |
120 |
|
( Brand_mainline , "Mainline" , "mai" ) ; |
121 |
|
( Brand_martiniman , "Martini Man" , "mar" ) ; |
122 |
|
( Brand_mldonkey , "MLdonkey" , "mld" ) ; |
123 |
|
( Brand_moonlighttorrent , "MoonlightTorrent" , "mlt" ) ; |
124 |
|
( Brand_plus , "Plus" , "plu" ) ; |
125 |
|
( Brand_shadow , "Shad0w" , "sdo" ) ; |
126 |
|
( Brand_sharenet , "Sharenet" , "shn" ) ; |
127 |
|
( Brand_shareaza , "Shareaza" , "shz" ) ; |
128 |
|
( Brand_simplebt , "SimpleBT" , "sbt" ) ; |
129 |
|
( Brand_snark , "Snark" , "snk" ) ; |
130 |
|
( Brand_swarmscope , "SwarmScope" , "sws" ) ; |
131 |
|
( Brand_swarmy , "Swarmy" , "swy" ) ; |
132 |
|
( Brand_swiftbit , "SwiftBit" , "swb" ) ; |
133 |
|
( Brand_teeweety , "Teeweety" , "twt" ) ; |
134 |
|
( Brand_torrentdotnet , "Torrent.NET" , "t.n" ) ; |
135 |
|
( Brand_torrentstorm , "TorrentStorm" , "sto" ) ; |
136 |
|
( Brand_turbobt , "TurboBT" , "tbt" ) ; |
137 |
|
( Brand_upnp , "UPNP" , "upn" ) ; |
138 |
|
( Brand_xantorrent , "XanTorrent" , "xat" ) ; |
139 |
|
( Brand_xbt , "XBT" , "xbt" ) ; |
140 |
|
( Brand_ziptorrent , "ZipTorrent" , "zit" ) ; |
141 |
|
( Brand_moopolice , "MooPolice" , "moo" ) ; |
142 |
|
( Brand_utorrent , "uTorrent" , "uTo" ) ; |
143 |
|
( Brand_opera , "Opera" , "opr" ) ; |
144 |
|
] |
145 |
|
|
146 |
|
let brand_count = List.length brand_list |
147 |
|
|
148 |
let brand_count = 43 |
let brand_to_string brand = |
149 |
|
find_brand_to_string brand brand_list false |
150 |
|
|
151 |
type brand_stat = { |
let brand_to_string_short brand = |
152 |
mutable brand_seen : int; |
find_brand_to_string brand brand_list true |
153 |
mutable brand_banned : int; |
|
154 |
mutable brand_filerequest : int; |
let brand_to_int brand = |
155 |
mutable brand_download : Int64.t; |
find_int_of_brand brand brand_list |
|
mutable brand_upload : Int64.t; |
|
|
} |
|
|
|
|
|
let dummy_stats = |
|
|
{ |
|
|
brand_seen = 0; |
|
|
brand_banned = 0; |
|
|
brand_filerequest = 0; |
|
|
brand_download = Int64.zero; |
|
|
brand_upload = Int64.zero |
|
|
} |
|
156 |
|
|
157 |
type client = { |
type client = { |
158 |
client_client : client CommonClient.client_impl; |
client_client : client CommonClient.client_impl; |
196 |
mutable client_incoming : bool; |
mutable client_incoming : bool; |
197 |
mutable client_registered_bitfield : bool; |
mutable client_registered_bitfield : bool; |
198 |
mutable client_last_optimist : int; |
mutable client_last_optimist : int; |
|
mutable client_software : string; |
|
199 |
} |
} |
200 |
|
|
201 |
and tracker_info = { |
and tracker_info = { |