/[mldonkey]/mldonkey/src/daemon/common/commonFile.ml
ViewVC logotype

Diff of /mldonkey/src/daemon/common/commonFile.ml

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

revision 1.32 by spiralvoice, Mon Jun 20 18:54:47 2005 UTC revision 1.33 by spiralvoice, Thu Jul 7 00:25:45 2005 UTC
# Line 150  let files_by_num = H.create 1027 Line 150  let files_by_num = H.create 1027
150  let ni n m =  let ni n m =
151    let s = Printf.sprintf "File.%s not implemented by %s"    let s = Printf.sprintf "File.%s not implemented by %s"
152        m n.network_name in        m n.network_name in
153    lprintf "%s\n" s;    lprintf_nl "%s" s;
154    s    s
155        
156  let fni n m = failwith (ni n m)  let fni n m = failwith (ni n m)
# Line 741  let new_file_ops network = Line 741  let new_file_ops network =
741    f    f
742    
743  let check_file_implementations () =  let check_file_implementations () =
744    lprintf "\n---- Methods not implemented for CommonFile ----\n";    lprintf_nl "\n---- Methods not implemented for CommonFile ----\n";
745    List.iter (fun (c, cc) ->    List.iter (fun (c, cc) ->
746        let n = c.op_file_network.network_name in        let n = c.op_file_network.network_name in
747        lprintf "\n  Network %s\n" n;        lprintf_nl "\n  Network %s" n;
748        if c.op_file_to_option == cc.op_file_to_option then        if c.op_file_to_option == cc.op_file_to_option then
749          lprintf "op_file_to_option\n";          lprintf_nl "op_file_to_option";
750        if c.op_file_info == cc.op_file_info then        if c.op_file_info == cc.op_file_info then
751          lprintf "op_file_info\n";          lprintf_nl "op_file_info";
752        if c.op_file_commit == cc.op_file_commit then        if c.op_file_commit == cc.op_file_commit then
753          lprintf "op_file_commit\n";          lprintf_nl "op_file_commit";
754        if c.op_file_save_as == cc.op_file_save_as then        if c.op_file_save_as == cc.op_file_save_as then
755          lprintf "op_file_save_as\n";          lprintf_nl "op_file_save_as";
756        if c.op_file_cancel == cc.op_file_cancel then        if c.op_file_cancel == cc.op_file_cancel then
757          lprintf "op_file_cancel\n";          lprintf_nl "op_file_cancel";
758        if c.op_file_pause == cc.op_file_pause then        if c.op_file_pause == cc.op_file_pause then
759          lprintf "op_file_pause\n";          lprintf_nl "op_file_pause";
760        if c.op_file_resume == cc.op_file_resume then        if c.op_file_resume == cc.op_file_resume then
761          lprintf "op_file_resume\n";          lprintf_nl "op_file_resume";
762  (*      if c.op_file_disk_name == cc.op_file_disk_name then  (*      if c.op_file_disk_name == cc.op_file_disk_name then
763          lprintf "op_file_disk_name\n"; *)          lprintf_nl "op_file_disk_name"; *)
764        if c.op_file_check == cc.op_file_check then        if c.op_file_check == cc.op_file_check then
765          lprintf "op_file_check\n";          lprintf_nl "op_file_check";
766        if c.op_file_recover == cc.op_file_recover then        if c.op_file_recover == cc.op_file_recover then
767          lprintf "op_file_recover\n";          lprintf_nl "op_file_recover";
768        if c.op_file_set_format == cc.op_file_set_format then        if c.op_file_set_format == cc.op_file_set_format then
769          lprintf "op_file_set_format\n";          lprintf_nl "op_file_set_format";
770        if c.op_file_all_sources == cc.op_file_all_sources then        if c.op_file_all_sources == cc.op_file_all_sources then
771          lprintf "op_file_all_sources\n";          lprintf_nl "op_file_all_sources";
772        if c.op_file_active_sources == cc.op_file_active_sources then        if c.op_file_active_sources == cc.op_file_active_sources then
773          lprintf "op_file_active_sources\n";          lprintf_nl "op_file_active_sources";
774        if c.op_file_print_html == cc.op_file_print_html then        if c.op_file_print_html == cc.op_file_print_html then
775          lprintf "op_file_print_html\n";          lprintf_nl "op_file_print_html";
776        if c.op_file_print_sources_html == cc.op_file_print_sources_html then        if c.op_file_print_sources_html == cc.op_file_print_sources_html then
777          lprintf "op_file_print_sources_html\n";          lprintf_nl "op_file_print_sources_html";
778    ) !files_ops;    ) !files_ops;
779    lprint_newline ()    lprintf_nl ""
780    
781  (*************************************************************************)  (*************************************************************************)
782  (*                                                                       *)  (*                                                                       *)
# Line 812  let file_write file offset s pos len = Line 812  let file_write file offset s pos len =
812  let file_verify file key begin_pos end_pos =  let file_verify file key begin_pos end_pos =
813    Unix32.flush_fd (file_fd file);    Unix32.flush_fd (file_fd file);
814    if !verbose_md4 then begin    if !verbose_md4 then begin
815        lprintf "Checksum to compute: %Ld-%Ld of %s\n" begin_pos end_pos        lprintf_nl "Checksum to compute: %Ld-%Ld of %s" begin_pos end_pos
816          (file_disk_name file);          (file_disk_name file);
817      end;      end;
818    try    try
# Line 834  let file_verify file key begin_pos end_p Line 834  let file_verify file key begin_pos end_p
834      in      in
835      let result = computed = key in      let result = computed = key in
836      if !verbose_md4 then begin      if !verbose_md4 then begin
837          lprintf "Checksum computed: %s against %s = %s\n"          lprintf_nl "Checksum computed: %s against %s = %s"
838            (string_of_uid key)            (string_of_uid key)
839          (string_of_uid computed)          (string_of_uid computed)
840          (if result then "VERIFIED" else "CORRUPTED");          (if result then "VERIFIED" else "CORRUPTED");
# Line 842  let file_verify file key begin_pos end_p Line 842  let file_verify file key begin_pos end_p
842      result      result
843    with    with
844      | Not_found -> raise Not_found      | Not_found -> raise Not_found
845      | _ -> if !verbose_md4 then lprintf "Checksum computed: chunk MISSING\n";      | _ -> if !verbose_md4 then lprintf_nl "Checksum computed: chunk MISSING";
846      false      false
847    
848  let file_mtime file = Unix32.mtime64 (file_fd file)  let file_mtime file = Unix32.mtime64 (file_fd file)

Legend:
Removed from v.1.32  
changed lines
  Added in v.1.33

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