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, 13 Nov 2006 13:10:17 +0000

CVSROOT:        /sources/mldonkey
Module name:    mldonkey
Changes by:     spiralvoice <spiralvoice>       06/11/13 13:10:17

Modified files:
        distrib        : ChangeLog 
        src/daemon/common: commonComplexOptions.ml commonTypes.ml 
        src/daemon/driver: driverCommands.ml 

Log message:
        patch #5546

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/mldonkey/distrib/ChangeLog?cvsroot=mldonkey&r1=1.1086&r2=1.1087
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/common/commonComplexOptions.ml?cvsroot=mldonkey&r1=1.66&r2=1.67
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/common/commonTypes.ml?cvsroot=mldonkey&r1=1.61&r2=1.62
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/driver/driverCommands.ml?cvsroot=mldonkey&r1=1.193&r2=1.194

Patches:
Index: distrib/ChangeLog
===================================================================
RCS file: /sources/mldonkey/mldonkey/distrib/ChangeLog,v
retrieving revision 1.1086
retrieving revision 1.1087
diff -u -b -r1.1086 -r1.1087
--- distrib/ChangeLog   13 Nov 2006 13:08:42 -0000      1.1086
+++ distrib/ChangeLog   13 Nov 2006 13:10:17 -0000      1.1087
@@ -15,6 +15,12 @@
 =========
 
 2006/11/13
+5546: Some sharing updates
+- solved bug 10957, updating the prio of an already shared dir is now possible
+- fix bug where missing shared dirs with strategy incoming_* where not 
recreated
+- remove "network = []" from downloads.ini, currently not supported
+- created workaround to fix bug on MinGW: no files were shared. Introduced by
+  patch 5475, but source of problem is Ocaml bug 4159
 5547: HTML: Fix unicode display in vd & upstats javascript popups
 
 2006/11/12

Index: src/daemon/common/commonComplexOptions.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonComplexOptions.ml,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -b -r1.66 -r1.67
--- src/daemon/common/commonComplexOptions.ml   12 Nov 2006 12:36:14 -0000      
1.66
+++ src/daemon/common/commonComplexOptions.ml   13 Nov 2006 13:10:17 -0000      
1.67
@@ -849,16 +849,18 @@
             in
             let shdir_priority = get_value_safe "priority" value_to_int 0
             in
+(*
             let shdir_networks = get_value_safe "networks"
                 (value_to_list value_to_string) [] 
             in
+*)
             let shdir_strategy = get_value_safe "strategy"
                 value_to_string "only_directory"
             in
             {
               shdir_dirname = shdir_dirname; 
               shdir_strategy = shdir_strategy; 
-              shdir_networks = shdir_networks; 
+              shdir_networks = []; (* shdir_networks; *)
               shdir_priority = shdir_priority; 
             }
           end
@@ -884,8 +886,10 @@
     let shared_directory_to_value s =
       let list = [
           "dirname", filename_to_value s.shdir_dirname;
+(*
           "networks", 
           list_to_value string_to_value s.shdir_networks;
+*)
           "strategy", 
           string_to_value  s.shdir_strategy;
           "priority", int_to_value s.shdir_priority;
@@ -899,6 +903,19 @@
 
   end
     
+let default_incoming_files = {
+  shdir_dirname = Filename.concat "incoming" "files";
+  shdir_priority = 0;
+  shdir_networks = [];
+  shdir_strategy = "incoming_files";
+  }
+
+let default_incoming_directories = {
+  shdir_dirname = Filename.concat "incoming" "directories";
+  shdir_priority = 0;
+  shdir_networks = [];
+  shdir_strategy = "incoming_directories";
+  }
   
 let shared_directories = 
   define_option CommonOptions.path_section ["shared_directories" ] 
@@ -911,8 +928,8 @@
    Finished BT multifile downloads are committed to the first directory
    with strategy incoming_directories. Other downloads are committed
    to the first directory with the strategy incoming_files.
-   If more than one directory has one of the incoming_* strategies
-   it will be ignored on commit, but they are shared nonetheless.
+   MLdonkey searches all shared_directories with incoming_* strategies
+   on commit and uses the first one with enough free diskspace.
    Other strategies can be found in searches.ini, section customized_sharing."
     (list_option SharedDirectoryOption.t) 
   [
@@ -922,52 +939,28 @@
       shdir_networks = [];
       shdir_strategy = "all_files";
     };
-    {
-      shdir_dirname = "incoming/files";
-      shdir_priority = 0;
-      shdir_networks = [];
-      shdir_strategy = "incoming_files";
-    };
-    {
-      shdir_dirname = "incoming/directories";
-      shdir_priority = 0;
-      shdir_networks = [];
-      shdir_strategy = "incoming_directories";
-    }
+    default_incoming_files;
+    default_incoming_directories;
   ]
 
 
 let search_incoming_files () =
-  try
-    List.find_all (fun s -> s.shdir_strategy = "incoming_files") 
-    !!shared_directories
-  with Not_found ->
-        let dirname = Filename.concat "incoming" "files" in
-        let s = {
-        shdir_dirname = dirname;
-        shdir_priority = 0;
-        shdir_networks = [];
-        shdir_strategy = "incoming_files";
-          }
+  let list =
+    List.filter (fun s -> s.shdir_strategy = "incoming_files") 
!!shared_directories
         in
-        shared_directories =:= s :: !!shared_directories;
-        [s]
+  match list with
+  | [] -> shared_directories =:= default_incoming_files :: 
!!shared_directories;
+        [default_incoming_files]
+  | l -> l
 
 let search_incoming_directories () =
-  try
-    List.find_all (fun s -> s.shdir_strategy = "incoming_directories") 
-    !!shared_directories
-  with Not_found ->
-      let dirname = Filename.concat "incoming" "directories" in
-      let s = {
-          shdir_dirname = dirname;
-          shdir_priority = 0;
-          shdir_networks = [];
-          shdir_strategy = "incoming_directories";
-        }
+  let list =
+    List.filter (fun s -> s.shdir_strategy = "incoming_directories") 
!!shared_directories
       in
-      shared_directories =:= s :: !!shared_directories;
-      [s]
+  match list with
+  | [] -> shared_directories =:= default_incoming_directories :: 
!!shared_directories;
+        [default_incoming_directories]
+  | l -> l
 
 exception Incoming_full
 
@@ -995,7 +988,7 @@
 *)
 (* todo: make the dir naming order user configurable *)
   let compute_dir_name dir =
-    let dirname = Filename.concat dir dirname_user in
+    let dirname = Filename2.normalize (Filename.concat dir dirname_user) in
 (*    let dirname = Filename.concat dirname dirname_network in *)
     dirname
   in

Index: src/daemon/common/commonTypes.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonTypes.ml,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -b -r1.61 -r1.62
--- src/daemon/common/commonTypes.ml    12 Nov 2006 14:17:45 -0000      1.61
+++ src/daemon/common/commonTypes.ml    13 Nov 2006 13:10:17 -0000      1.62
@@ -350,7 +350,7 @@
 
 type shared_directory = {
     shdir_dirname : string;
-    shdir_priority : int;
+    mutable shdir_priority : int;
     shdir_strategy : string;
     shdir_networks : string list;
   }

Index: src/daemon/driver/driverCommands.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/driver/driverCommands.ml,v
retrieving revision 1.193
retrieving revision 1.194
diff -u -b -r1.193 -r1.194
--- src/daemon/driver/driverCommands.ml 9 Nov 2006 21:32:26 -0000       1.193
+++ src/daemon/driver/driverCommands.ml 13 Nov 2006 13:10:17 -0000      1.194
@@ -2230,17 +2230,22 @@
           } in
 
         if Unix2.is_directory arg then
-          if not (List.mem shdir !!shared_directories) then begin
+         begin
+           try
+             let d = List.find (fun d -> d.shdir_dirname = arg) 
!!shared_directories in
+             let old_prio = d.shdir_priority in
+             d.shdir_priority <- prio;
+             Printf.sprintf "prio of %s changed from %d to %d"
+               d.shdir_dirname old_prio d.shdir_priority
+           with Not_found ->
               shared_directories =:= shdir :: !!shared_directories;
               shared_add_directory shdir;
-              "directory added"
-            end (* else
-            if not (List.mem (arg, prio) !!shared_directories) then begin
-              shared_directories =:= (arg, prio) :: List.remove_assoc arg 
!!shared_directories;
-              shared_add_directory (arg, prio);
-              "prio changed"
-            end *) else
-            "directory already shared"
+              Printf.sprintf "directory %s added%s"
+               shdir.shdir_dirname
+               (if shdir.shdir_priority <> 0 then
+                   Printf.sprintf " with prio %d" shdir.shdir_priority
+                else "")
+         end
         else
           "no such directory"
     ), "<priority> <dir> [<strategy>] :\tshare directory <dir> with <priority> 
[and sharing strategy <strategy>]";




reply via email to

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