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

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

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

revision 1.16 by spiralvoice, Wed Mar 2 19:28:14 2005 UTC revision 1.17 by spiralvoice, Mon Jun 20 18:38:49 2005 UTC
# Line 145  module Connect  = struct Line 145  module Connect  = struct
145            
146      let print t =      let print t =
147        lprintf "CONNECT:\n";        lprintf "CONNECT:\n";
148        lprintf "version: %d" t.version; lprint_newline ();        lprintf "version: %d\n" t.version;
149        lprintf "MD4: %s\n" (Md4.to_string t.md4);        lprintf "MD4: %s\n" (Md4.to_string t.md4);
150        lprintf "ip: %s\n" (Ip.to_string t.ip);        lprintf "ip: %s\n" (Ip.to_string t.ip);
151        lprintf "port: %d\n" t.port;        lprintf "port: %d\n" t.port;
# Line 336  let get_bitmap s pos = Line 336  let get_bitmap s pos =
336    chunks, pos    chunks, pos
337    
338  let print_bitmap chunks =  let print_bitmap chunks =
339    lprint_newline ();    lprint_string "\n   ";
   lprint_string "   ";  
340    Array.iter (fun b ->    Array.iter (fun b ->
341        if b then lprintf "1" else lprintf "0") chunks        if b then lprintf "1" else lprintf "0") chunks
342    
# Line 428  module QueryChunksReply = struct (* Requ Line 427  module QueryChunksReply = struct (* Requ
427        }        }
428                
429      let print t =      let print t =
430        lprintf "CHUNKS for %s" (Md4.to_string t.md4);        lprintf "CHUNKS for %s\n" (Md4.to_string t.md4);
       lprint_newline ();  
431        lprint_string "   ";        lprint_string "   ";
432        Array.iter (fun b ->        Array.iter (fun b ->
433            if b then lprintf "1" else lprintf "0") t.chunks;            if b then lprintf "1" else lprintf "0") t.chunks;
# Line 471  module QueryChunkMd4Reply = struct (* Re Line 469  module QueryChunkMd4Reply = struct (* Re
469        }        }
470    
471      let print t =      let print t =
472        lprintf "CHUNKS for %s" (Md4.to_string t.md4);        lprintf "CHUNKS for %s\n" (Md4.to_string t.md4);
       lprint_newline ();  
473        lprint_string "   ";        lprint_string "   ";
474        Array.iter (fun b ->        Array.iter (fun b ->
475            lprintf "  %s" (Md4.to_string b))            lprintf "  %s" (Md4.to_string b))
# Line 745  module Sources = struct Line 742  module Sources = struct
742        }        }
743            
744      let print t =      let print t =
745        lprintf "SOURCES for %s:\n" (Md4.to_string t.md4);        lprintf "SOURCES for %s:\n\n" (Md4.to_string t.md4);
       lprint_newline ();  
746        List.iter (fun (ip1, port, ip2) ->        List.iter (fun (ip1, port, ip2) ->
747            lprintf "  %s:%d:%s\n" (Ip.to_string ip1) port(Ip.to_string ip2);            lprintf "  %s:%d:%s\n" (Ip.to_string ip1) port(Ip.to_string ip2);
748            lprint_newline ();) t.sources            lprint_newline ();) t.sources
# Line 845  module EmuleQueueRanking = struct Line 841  module EmuleQueueRanking = struct
841                
842      let parse len s = get_int16 s 1            let parse len s = get_int16 s 1      
843      let print t =      let print t =
844        lprintf "QUEUE RANKING: %d" t; lprint_newline ()        lprintf "QUEUE RANKING: %d\n" t
845    
846      let string_null10 = String.make 10 (char_of_int 0)      let string_null10 = String.make 10 (char_of_int 0)
847                
# Line 861  module QueueRank = struct Line 857  module QueueRank = struct
857                
858      let parse len s = get_int s 1            let parse len s = get_int s 1      
859      let print t =      let print t =
860        lprintf "QUEUE RANK: %d" t; lprint_newline ()        lprintf "QUEUE RANK: %d\n" t
861    
862      let write buf t =      let write buf t =
863        buf_int buf t        buf_int buf t
# Line 876  module EmuleRequestSources = struct Line 872  module EmuleRequestSources = struct
872        get_md4 s 1        get_md4 s 1
873                
874      let print t =      let print t =
875        lprintf "EMULE REQUEST SOURCES: %s" (Md4.to_string t);        lprintf "EMULE REQUEST SOURCES: %s\n" (Md4.to_string t)
       lprint_newline ()  
876    
877      let write buf t =      let write buf t =
878        buf_md4 buf t        buf_md4 buf t
# Line 1292  and parse emule_version magic s = Line 1287  and parse emule_version magic s =
1287            with            with
1288            | e ->            | e ->
1289                if !CommonOptions.verbose_unknown_messages then begin                if !CommonOptions.verbose_unknown_messages then begin
1290                    lprintf "Unknown message From client: %s (magic %d)"                    lprintf "Unknown message From client: %s (magic %d)\n"
1291                      (Printexc2.to_string e) magic; lprint_newline ();                      (Printexc2.to_string e) magic;
1292                    let tmp_file = Filename.temp_file "comp" "pak" in                    let tmp_file = Filename.temp_file "comp" "pak" in
1293                    File.from_string tmp_file s;                    File.from_string tmp_file s;
1294                    lprintf "Saved unknown packet %s" tmp_file; lprint_newline ();                    lprintf "Saved unknown packet %s\n" tmp_file;
1295                                        
1296                    dump s;                    dump s;
1297                    lprint_newline ();                    lprint_newline ();
# Line 1314  and parse emule_version magic s = Line 1309  and parse emule_version magic s =
1309            end;                end;    
1310          UnknownReq s        *)          UnknownReq s        *)
1311      | _ ->      | _ ->
1312          if !CommonOptions.verbose_unknown_messages then begin          if !CommonOptions.verbose_unknown_messages then
1313              lprintf "Strange magic: %d" magic; lprint_newline ();              lprintf "Strange magic: %d\n" magic;
           end;  
1314          raise Not_found          raise Not_found
1315    with    with
1316    | e ->    | e ->
1317        if !CommonOptions.verbose_unknown_messages then begin        if !CommonOptions.verbose_unknown_messages then begin
1318            lprintf "Unknown message From client: %s (magic %d)"            lprintf "Unknown message From client: %s (magic %d)\n"
1319                (Printexc2.to_string e) magic; lprint_newline ();                (Printexc2.to_string e) magic;
1320                       let tmp_file = Filename.temp_file "comp" "pak" in                       let tmp_file = Filename.temp_file "comp" "pak" in
1321               File.from_string tmp_file s;               File.from_string tmp_file s;
1322               lprintf "Saved unknown packet %s" tmp_file; lprint_newline ();               lprintf "Saved unknown packet %s\n" tmp_file;
1323    
1324            dump s;            dump s;
1325            lprint_newline ();            lprint_newline ();

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

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