24 |
|
|
25 |
let bittorrent_ini = create_options_file "bittorrent.ini" |
let bittorrent_ini = create_options_file "bittorrent.ini" |
26 |
let bittorrent_section = file_section bittorrent_ini ["Bittorrent"] "Bittorrent options" |
let bittorrent_section = file_section bittorrent_ini ["Bittorrent"] "Bittorrent options" |
27 |
|
|
28 |
let client_port = define_option bittorrent_section ["client_port"] |
let client_port = define_option bittorrent_section ["client_port"] |
29 |
"The port to bind the client to" |
"The port to bind the client to" |
30 |
int_option 6882 |
int_option 6882 |
31 |
|
|
|
|
|
32 |
let client_uid = define_option bittorrent_section ["client_uid"] |
let client_uid = define_option bittorrent_section ["client_uid"] |
33 |
"The UID of this client" Sha1.option (Sha1.random ()) |
"The UID of this client" Sha1.option (Sha1.random ()) |
34 |
|
|
|
|
|
35 |
let shortname o = |
let shortname o = |
36 |
Printf.sprintf "BT-%s" (shortname o) |
Printf.sprintf "BT-%s" (shortname o) |
37 |
|
|
38 |
let gui_bittorrent_options_panel = |
let gui_bittorrent_options_panel = |
|
(* |
|
|
define_option bittorrent_section ["gui_bittorrent_options_panel"] |
|
|
"Which options are configurable in the GUI option panel, and in the |
|
|
bittorrent section. Last entry indicates the kind of widget used (B=Boolean,T=Text)" |
|
|
(list_option (tuple3_option (string_option, string_option, string_option))) |
|
|
*) |
|
|
|
|
39 |
[ |
[ |
40 |
"Port", shortname client_port, "T"; |
"Port", shortname client_port, "T"; |
41 |
] |
] |
42 |
|
|
|
|
|
|
|
|
|
(* |
|
|
let torrent_files = |
|
|
define_option bittorrent_section ["torrent_files"] |
|
|
"The torrent files to serve on the tracker WEB server" |
|
|
(list_option (tuple2_option (string_option, filename_option))) [] |
|
|
|
|
|
let tracked_files = |
|
|
define_option bittorrent_section ["tracked_files"] |
|
|
"The files tarcked on this tracker" |
|
|
(list_option filename_option) [] |
|
|
|
|
|
let shared_files = |
|
|
define_option bittorrent_section ["shared_files"] |
|
|
"The files shared on this torrent server (pair .torrent file, and path to shared file or directory)" |
|
|
(list_option (tuple2_option (filename_option, filename_option))) [] |
|
|
*) |
|
|
|
|
43 |
let ask_tracker_threshold = define_option bittorrent_section ["ask_tracker_threshold"] |
let ask_tracker_threshold = define_option bittorrent_section ["ask_tracker_threshold"] |
44 |
"Ask the tracker for new sources only if you have fewer than that number of sources" |
"Ask the tracker for new sources only if you have fewer than that number of sources" |
45 |
int_option 20 |
int_option 20 |
52 |
"Maximum number of uploaders for bittorrent" |
"Maximum number of uploaders for bittorrent" |
53 |
int_option 5 |
int_option 5 |
54 |
|
|
55 |
(* numwant: Optional. Number of peers that the client would like to receive from the tracker. |
(* numwant: Optional. Number of peers that the client would like to receive from the tracker. |
56 |
This value is permitted to be zero. If omitted, typically defaults to 50 peers. *) |
This value is permitted to be zero. If omitted, typically defaults to 50 peers. *) |
57 |
|
|
58 |
let numwant = define_option bittorrent_section ["numwant"] |
let numwant = define_option bittorrent_section ["numwant"] |
72 |
(fun _ -> |
(fun _ -> |
73 |
if !!max_bt_uploaders < 0 then max_bt_uploaders =:= 5) |
if !!max_bt_uploaders < 0 then max_bt_uploaders =:= 5) |
74 |
end |
end |
75 |
|
|
|
|
|
76 |
let cookies = define_option bittorrent_section ["cookies"] |
let cookies = define_option bittorrent_section ["cookies"] |
77 |
"Cookies send with http request to get .torrent file" |
"Cookies send with http request to get .torrent file" |
78 |
(list_option (tuple2_option (string_option, list_option (tuple2_option (string_option, string_option))))) [] |
(list_option (tuple2_option (string_option, list_option (tuple2_option (string_option, string_option))))) [] |
80 |
let referers = define_option bittorrent_section ["referers"] |
let referers = define_option bittorrent_section ["referers"] |
81 |
"Referer sent with http request to get .torrent file" |
"Referer sent with http request to get .torrent file" |
82 |
(list_option (tuple2_option (string_option, string_option))) [(".*suprnova.*", "http://www.suprnova.org/")] |
(list_option (tuple2_option (string_option, string_option))) [(".*suprnova.*", "http://www.suprnova.org/")] |
83 |
|
|