/[mldonkey]/mldonkey/src/networks/bittorrent/bTOptions.ml
ViewVC logotype

Diff of /mldonkey/src/networks/bittorrent/bTOptions.ml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.18 by spiralvoice, Thu Aug 4 22:00:23 2005 UTC revision 1.19 by spiralvoice, Sun Aug 7 12:57:22 2005 UTC
# Line 30  let client_port = define_option bittorre Line 30  let client_port = define_option bittorre
30      int_option 6882      int_option 6882
31    
32  (* Generate client_uid *)  (* Generate client_uid *)
33  let generate_client_uid =  let generate_client_uid =
34    let client_uid_from_version = "-ML" ^ Autoconf.current_version ^ "-" in    let client_uid_from_version = "-ML" ^ Autoconf.current_version ^ "-" in
35    let client_uid_random_tail = String.create (20 - (String.length client_uid_from_version)) in    let client_uid_random_tail = String.create (20 - (String.length client_uid_from_version)) in
36    let sl_client_uid_random_tail = String.length client_uid_random_tail in    let sl_client_uid_random_tail = String.length client_uid_random_tail in
# Line 44  let client_uid = define_option bittorren Line 44  let client_uid = define_option bittorren
44      "The UID of this client" Sha1.option (Sha1.direct_of_string generate_client_uid)      "The UID of this client" Sha1.option (Sha1.direct_of_string generate_client_uid)
45    
46  (* Check if the uid is in sync with Autoconf.current_version *)  (* Check if the uid is in sync with Autoconf.current_version *)
47  let check_client_uid () =  let check_client_uid () =
48    let s = Sha1.direct_to_string !!client_uid in    let s = Sha1.direct_to_string !!client_uid in
49    if Autoconf.current_version != String.sub s 3 ((    if Autoconf.current_version != String.sub s 3 ((
50      try      try
51        String.index_from s 1 s.[0]        String.index_from s 1 s.[0]
52      with      with
53        Not_found -> 3        Not_found -> 3
54      ) - 3) then      ) - 3) then
55      client_uid =:= Sha1.direct_of_string generate_client_uid      client_uid =:= Sha1.direct_of_string generate_client_uid
# Line 104  let cookies = define_option bittorrent_s Line 104  let cookies = define_option bittorrent_s
104      (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))))) []
105    
106  let referers = define_option bittorrent_section ["referers"]  let referers = define_option bittorrent_section ["referers"]
107      "Referer sent with http request to get .torrent file"      "Referer sent with http request to get .torrent file"
108      (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/")]
109    

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26