mldonkey-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co...


From: mldonkey-commits
Subject: [Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co...
Date: Mon, 06 Feb 2006 21:45:04 +0000

CVSROOT:        /sources/mldonkey
Module name:    mldonkey
Branch:         
Changes by:     spiralvoice <address@hidden>    06/02/06 21:45:04

Modified files:
        distrib        : ChangeLog 
        src/daemon/common: commonHasher.ml commonShared.ml 
        src/networks/donkey: donkeyMain.ml donkeyOptions.ml 
                             donkeyShare.ml 

Log message:
        patch #4849

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/distrib/ChangeLog.diff?tr1=1.721&tr2=1.722&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/daemon/common/commonHasher.ml.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/daemon/common/commonShared.ml.diff?tr1=1.28&tr2=1.29&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/networks/donkey/donkeyMain.ml.diff?tr1=1.45&tr2=1.46&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/networks/donkey/donkeyOptions.ml.diff?tr1=1.38&tr2=1.39&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/networks/donkey/donkeyShare.ml.diff?tr1=1.37&tr2=1.38&r1=text&r2=text

Patches:
Index: mldonkey/distrib/ChangeLog
diff -u mldonkey/distrib/ChangeLog:1.721 mldonkey/distrib/ChangeLog:1.722
--- mldonkey/distrib/ChangeLog:1.721    Mon Feb  6 12:54:57 2006
+++ mldonkey/distrib/ChangeLog  Mon Feb  6 21:45:03 2006
@@ -15,6 +15,10 @@
 =========
 
 2006/02/06
+4849: EDK: Fix hashing of newly shared files
+- avoid hashing shared files twice
+- avoid problems while hashing big files
+- remove obsolete compute_md4_delay option
 4878: Addition to patch 4875 (conditional bzip2 support using cpp)
 
 2006/02/05
Index: mldonkey/src/daemon/common/commonHasher.ml
diff -u mldonkey/src/daemon/common/commonHasher.ml:1.7 
mldonkey/src/daemon/common/commonHasher.ml:1.8
--- mldonkey/src/daemon/common/commonHasher.ml:1.7      Sat Dec 24 02:36:09 2005
+++ mldonkey/src/daemon/common/commonHasher.ml  Mon Feb  6 21:45:03 2006
@@ -69,15 +69,10 @@
           try
             let fd = Unix.openfile job.job_name [Unix.O_RDONLY] 0o444 in
             current_job := Some (job, fd);
-            if !verbose_md4 then begin
-                lprintf_nl "[cHa] Starting job %s %Ld %Ld %s" job.job_name
-                  job.job_begin job.job_len
-                  (match job.job_method with
-                    MD5 -> "MD5"
-                  | TIGER -> "TIGER"
-                  | SHA1 -> "SHA1"
-                  | MD4 -> "MD4");
-              end;
+            if !verbose_md4 then lprintf_nl "[cHa] Starting %s job %s %Ld %Ld" 
+              (match job.job_method with
+               MD5 -> "MD5" | TIGER -> "TIGER" | SHA1 -> "SHA1" | MD4 -> "MD4")
+                  job.job_name job.job_begin job.job_len;
             job_start job fd;
           with e ->
               lprintf_nl "[cHa] Exception %s in starting job"
Index: mldonkey/src/daemon/common/commonShared.ml
diff -u mldonkey/src/daemon/common/commonShared.ml:1.28 
mldonkey/src/daemon/common/commonShared.ml:1.29
--- mldonkey/src/daemon/common/commonShared.ml:1.28     Mon Jan  9 00:25:58 2006
+++ mldonkey/src/daemon/common/commonShared.ml  Mon Feb  6 21:45:04 2006
@@ -80,7 +80,7 @@
 let ni_ok n m = ignore (ni n m)
 
 let lprintf_nl () =
-  lprintf "%s[cShared]: "
+  lprintf "%s[cSha] "
   (log_time ()); lprintf_nl2
     
 let shared_calculate_total_bytes () =
@@ -258,7 +258,7 @@
             try
               if Unix2.is_directory full_name then begin
                if strategy.sharing_recursive then
-                 if Sys.os_type <> "Win32" then (* Win32 means MinGW here as 
it does not supports inode nums *)
+                 if Autoconf.system <> "mingw" then
                  begin
                    let inode = ((Unix.stat full_name).Unix.st_ino) in
                      if inode = incoming_files_inode then
Index: mldonkey/src/networks/donkey/donkeyMain.ml
diff -u mldonkey/src/networks/donkey/donkeyMain.ml:1.45 
mldonkey/src/networks/donkey/donkeyMain.ml:1.46
--- mldonkey/src/networks/donkey/donkeyMain.ml:1.45     Thu Jan 26 00:25:25 2006
+++ mldonkey/src/networks/donkey/donkeyMain.ml  Mon Feb  6 21:45:04 2006
@@ -79,7 +79,13 @@
         if !verbose_sources > 2 then 
           lprintf_nl () "Exception %s while checking sources" 
             (Printexc2.to_string e)
-  )
+  );
+  DonkeyServers.udp_walker_timer ()
+
+let five_second_timer timer =
+  DonkeyServers.walker_timer ();
+  DonkeyOneFile.check_files_downloaded ();
+  DonkeyShare.check_shared_files ()
 
 let min_timer timer =
   DonkeySources.clean_sources (); (* Moved here from fivemin_timer. *)
@@ -311,19 +317,14 @@
       
       add_session_option_timer enabler check_connections_delay 
         DonkeyServers.check_server_connections;
-      add_session_option_timer enabler compute_md4_delay 
-        (fun _ ->
-          DonkeyOneFile.check_files_downloaded ();
-          DonkeyShare.check_shared_files ()
-      );
-      add_session_timer enabler 5.0 DonkeyServers.walker_timer;
-      add_session_timer enabler 1.0 DonkeyServers.udp_walker_timer;
+
       
       add_session_timer enabler 3600. hourly_timer;
       add_session_timer enabler 60. min_timer;
       add_session_timer enabler 300. fivemin_timer;
       add_session_timer enabler 900. quarter_timer;
       add_session_timer enabler 1. second_timer;
+      add_session_timer enabler 5. five_second_timer;
       add_session_option_timer enabler remove_old_servers_delay 
           DonkeyServers.remove_old_servers;
 
Index: mldonkey/src/networks/donkey/donkeyOptions.ml
diff -u mldonkey/src/networks/donkey/donkeyOptions.ml:1.38 
mldonkey/src/networks/donkey/donkeyOptions.ml:1.39
--- mldonkey/src/networks/donkey/donkeyOptions.ml:1.38  Sun Feb  5 13:48:53 2006
+++ mldonkey/src/networks/donkey/donkeyOptions.ml       Mon Feb  6 21:45:04 2006
@@ -78,14 +78,6 @@
     string_option "" (* (cmd_basedir ^ "local_index_add") *)
 *)
 
-let compute_md4_delay = define_expert_option donkey_section 
["compute_md4_delay"]
-    "The delay between computations of the md4 of chunks"
-  float_option 1.
-
-let _ =
-  option_hook compute_md4_delay (fun _ ->
-      if !!compute_md4_delay < 0.1 then compute_md4_delay =:= 0.1)
-
 let server_black_list = define_option donkey_section
     ["server_black_list"] "A list of server IP to remove from server list.
     Servers on this list can't be added, and will eventually be removed"
Index: mldonkey/src/networks/donkey/donkeyShare.ml
diff -u mldonkey/src/networks/donkey/donkeyShare.ml:1.37 
mldonkey/src/networks/donkey/donkeyShare.ml:1.38
--- mldonkey/src/networks/donkey/donkeyShare.ml:1.37    Mon Jan  9 00:25:59 2006
+++ mldonkey/src/networks/donkey/donkeyShare.ml Mon Feb  6 21:45:04 2006
@@ -206,10 +206,6 @@
     match !shared_files with
       [] -> ()
     | sh :: files ->
-        shared_files := files;
-
-(*      lprintf "check_shared_files"; lprint_newline (); *)
-
         let rec job_creater _ =
           try
             if not (Sys.file_exists sh.shared_name) then begin
@@ -225,7 +221,7 @@
             let end_pos = if end_pos > sh.shared_size then sh.shared_size
               else end_pos in
             let len = end_pos -- sh.shared_pos in
-(*          lprintf "compute next md4"; lprint_newline (); *)
+            if !verbose_md4 then lprintf_nl () "compute next md4 of %s" 
sh.shared_name;
 
             M.compute_md4 (Unix32.filename sh.shared_fd) sh.shared_pos len
               (fun job ->
@@ -234,7 +230,7 @@
                     lprintf_nl () "Error prevent sharing %s" sh.shared_name
                   end else
                 let _ = () in
-(*              lprintf "md4 computed"; lprint_newline (); *)
+               if !verbose_md4 then lprintf_nl () "computed md4 of %s" 
sh.shared_name;
                 let new_md4 = job.M.job_result in
 
                 sh.shared_list <- new_md4 :: sh.shared_list;
@@ -250,7 +246,8 @@
                     Hashtbl.add shared_files_info
                       (s.sh_name, s.sh_size, s.sh_mtime) s;
                     known_shared_files =:= s :: !!known_shared_files;
-                    new_file_to_share s sh.shared_shared.impl_shared_codedname 
(Some  sh.shared_shared);
+                   shared_files := files;
+                    new_file_to_share s sh.shared_shared.impl_shared_codedname 
(Some sh.shared_shared);
                   end
                 else
                   job_creater ())
@@ -284,19 +281,14 @@
             raise Not_found
           end *)
       with Not_found ->
-          if !verbose_share then begin
+          if !verbose_share then
               lprintf_nl () "donkeyShare: No info on %s" fullname;
-            end;
-
-          let rec iter list left =
-            match list with
-              [] -> List.rev left
-            | sh :: tail ->
-                if sh.shared_name = fullname then iter tail left
-                else iter tail (sh :: left)
-          in
-          shared_files := iter !shared_files [];
 
+         let found = ref false in
+         List.iter (fun sh -> if sh.shared_name = fullname then found := true) 
!shared_files;
+         if !found then
+           lprintf_nl () "avoid sharing %s" fullname
+         else begin
           let rec impl = {
               impl_shared_update = 1;
               impl_shared_fullname = fullname;
@@ -319,6 +311,7 @@
             } in
           update_shared_num impl;
           shared_files := pre_shared :: !shared_files;
+         end
   )
 
 let remember_shared_info file new_name =




reply via email to

[Prev in Thread] Current Thread [Next in Thread]