/[mldonkey]/mldonkey/src/networks/donkey/donkeyThieves.ml
ViewVC logotype

Diff of /mldonkey/src/networks/donkey/donkeyThieves.ml

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

revision 1.5 by spiralvoice, Mon Jun 20 18:38:49 2005 UTC revision 1.6 by spiralvoice, Mon Aug 8 16:47:31 2005 UTC
# Line 17  Line 17 
17      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  *)  *)
19    
20  (*  (*
21     Detect clients switching to another client_hash, already is use by     Detect clients switching to another client_hash, already is use by
22     someone else (almost certainly a theft).     someone else (almost certainly a theft).
23  *)  *)
# Line 99  let register_client_hash ip hash = Line 99  let register_client_hash ip hash =
99              by_hash := new_record;              by_hash := new_record;
100              true              true
101          | _, _, _ ->          | _, _, _ ->
102              (* it switched to a hash that's used somewhere else,              (* it switched to a hash that's used somewhere else,
103                 that's certainly a theft. *)                 that's certainly a theft. *)
104              if !verbose then              if !verbose then
105                lprintf "That hash was already used somewhere else, that's certainly a theft!\n";                lprintf "That hash was already used somewhere else, that's certainly a theft!\n";
# Line 125  module Marshal = struct Line 125  module Marshal = struct
125      let to_string v _ =      let to_string v _ =
126        let v = Marshal.to_string v [] in        let v = Marshal.to_string v [] in
127  (* The header depends on Ocaml version. Remove it. *)  (* The header depends on Ocaml version. Remove it. *)
128        let v = String.sub v (Marshal.header_size)        let v = String.sub v (Marshal.header_size)
129          (String.length v - Marshal.header_size) in          (String.length v - Marshal.header_size) in
130        v        v
131    
132    end      end
133    
134  (* test code *)  (* test code *)
135  (*  (*
# Line 162  let testcode () = Line 162  let testcode () =
162    lprintf "Third peer takes a hash that *was* first's hash, ok (?)...\n";    lprintf "Third peer takes a hash that *was* first's hash, ok (?)...\n";
163    assert(register_client_hash peer3 (Md4.of_string "11111111111111111111111111111111"));    assert(register_client_hash peer3 (Md4.of_string "11111111111111111111111111111111"));
164    dump ();    dump ();
165        
166    exit 2    exit 2
167    
168  let _ =  let _ =

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

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