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: Sat, 08 Apr 2006 02:16:22 +0000

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

Modified files:
        distrib        : ChangeLog 
        src/daemon/common: commonSources.ml commonSources.mli 
        src/networks/donkey: donkeyComplexOptions.ml 
                             donkeyComplexOptions.mli 
                             donkeyInteractive.ml 

Log message:
        patch #5029

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/distrib/ChangeLog.diff?tr1=1.794&tr2=1.795&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/daemon/common/commonSources.ml.diff?tr1=1.34&tr2=1.35&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/daemon/common/commonSources.mli.diff?tr1=1.9&tr2=1.10&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/networks/donkey/donkeyComplexOptions.ml.diff?tr1=1.44&tr2=1.45&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/networks/donkey/donkeyComplexOptions.mli.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/networks/donkey/donkeyInteractive.ml.diff?tr1=1.97&tr2=1.98&r1=text&r2=text

Patches:
Index: mldonkey/distrib/ChangeLog
diff -u mldonkey/distrib/ChangeLog:1.794 mldonkey/distrib/ChangeLog:1.795
--- mldonkey/distrib/ChangeLog:1.794    Sat Apr  8 02:10:06 2006
+++ mldonkey/distrib/ChangeLog  Sat Apr  8 02:16:21 2006
@@ -15,6 +15,7 @@
 =========
 
 2006/04/08
+5029: EDK: Remove set_brothers command and brotherhood option
 5030: Update config.guess and config.sub to version 2006-02-27
 4778: CommonSwarming: In addition to the first and last chunk also load
       the second last chunk if available before the rest to improve preview
Index: mldonkey/src/daemon/common/commonSources.ml
diff -u mldonkey/src/daemon/common/commonSources.ml:1.34 
mldonkey/src/daemon/common/commonSources.ml:1.35
--- mldonkey/src/daemon/common/commonSources.ml:1.34    Sun Jan  1 19:36:03 2006
+++ mldonkey/src/daemon/common/commonSources.ml Sat Apr  8 02:16:21 2006
@@ -213,7 +213,6 @@
           mutable manager_active_sources : int;
           mutable manager_all_sources : int;
           mutable manager_file : (unit -> file);
-          mutable manager_brothers : file_sources_manager list;
         }
 
       and functions = {
@@ -1251,7 +1250,6 @@
             manager_all_sources = 0;
             manager_active_sources = 0;
             manager_sources = create_queues ();
-            manager_brothers = [];
           } in
         file_sources_managers := m :: !file_sources_managers;
         m
@@ -1272,9 +1270,6 @@
 
         m.manager_sources <- create_queues ();
 
-        let brothers = List.filter (fun m' -> m' <> m) m.manager_brothers in
-        List.iter (fun m -> m.manager_brothers <- brothers) brothers;
-
         file_sources_managers := List2.removeq m !file_sources_managers
 
 
@@ -1444,14 +1439,7 @@
       let set_request_result s file result =
         set_request_score s file (match result with
             File_not_found -> not_found_score
-          | File_found ->
-(* Advertise the files associated with this file that this source is
-probably interesting. Since we are already connected, it means
-we will probably query for the other file almost immediatly. *)
-              List.iter (fun m ->
-                  set_request_score s m initial_new_source_score
-              ) file.manager_brothers;
-              found_score
+          | File_found -> found_score
           | File_chunk -> chunk_score
           | File_upload -> upload_score
           | File_new_source -> initial_new_source_score
@@ -1519,35 +1507,6 @@
 
 (*************************************************************************)
 (*                                                                       *)
-(*                         set_brothers                                  *)
-(*                                                                       *)
-(*************************************************************************)
-
-      let set_brothers files =
-        let brothers = ref [] in
-        let rec add_brother m =
-          if not (List.memq m !brothers) then begin
-              brothers := m :: !brothers;
-              List.iter add_brother m.manager_brothers
-            end
-        in
-        List.iter add_brother files;
-
-        List.iter (fun m ->
-            m.manager_brothers <- !brothers
-        ) !brothers
-
-(*************************************************************************)
-(*                                                                       *)
-(*                         get_brothers                                  *)
-(*                                                                       *)
-(*************************************************************************)
-
-      let get_brothers file =
-        List.map (fun m -> m.manager_uid) file.manager_brothers
-
-(*************************************************************************)
-(*                                                                       *)
 (*                         add_saved_source_request                      *)
 (*                                                                       *)
 (*************************************************************************)
Index: mldonkey/src/daemon/common/commonSources.mli
diff -u mldonkey/src/daemon/common/commonSources.mli:1.9 
mldonkey/src/daemon/common/commonSources.mli:1.10
--- mldonkey/src/daemon/common/commonSources.mli:1.9    Tue Oct 25 09:42:35 2005
+++ mldonkey/src/daemon/common/commonSources.mli        Sat Apr  8 02:16:21 2006
@@ -115,7 +115,6 @@
           mutable manager_active_sources : int;
           mutable manager_all_sources : int;
           mutable manager_file : (unit -> file);
-          mutable manager_brothers : file_sources_manager list;
         }
       
       and functions = {
@@ -180,9 +179,6 @@
       val iter_qualified_sources : (source -> unit) -> file_sources_manager -> 
unit
                        val iter_relevant_sources : (source -> unit) -> 
file_sources_manager -> unit
 
-      val set_brothers : file_sources_manager list -> unit
-      val get_brothers : file_sources_manager -> string list      
-        
       val source_brand : source -> M.source_brand
       val set_source_brand : source -> M.source_brand -> unit
     end)
Index: mldonkey/src/networks/donkey/donkeyComplexOptions.ml
diff -u mldonkey/src/networks/donkey/donkeyComplexOptions.ml:1.44 
mldonkey/src/networks/donkey/donkeyComplexOptions.ml:1.45
--- mldonkey/src/networks/donkey/donkeyComplexOptions.ml:1.44   Mon Apr  3 
20:50:09 2006
+++ mldonkey/src/networks/donkey/donkeyComplexOptions.ml        Sat Apr  8 
02:16:21 2006
@@ -120,13 +120,6 @@
       ) 
     with _ -> 
         failwith "Source without address: removed"
-(*
-        let md4 = try
-            get_value "client_md4" value_to_md4 with _ -> Md4.null
-        in
-        let name = try
-            get_value "client_name" value_to_string with _ -> "" in
-        Indirect_location(name, md4) *)
   in
   
   let _ = 
@@ -148,20 +141,6 @@
       get_value "client_name" value_to_string with _ -> "" in
   set_client_name l name md4;
   
-  (*
-  CommonGlobals.connection_set_last_conn l.client_connection_control
-    last_conn;
-*)  
-    
-(* Is it really useful ? I don't think so. It is only used when restarting
-the client several times, which is not that current... 
-  
-  (try
-     let last_filereqs =
-       (min (get_value "client_last_filereqs" value_to_float)
-         (BasicSocket.last_time ())) in
-       l.client_last_filereqs <- last_filereqs
-   with _ -> ()); *)
   if is_friend then friend_add l;
   l
   
@@ -179,10 +158,6 @@
   let list = [
       "client_md4", string_to_value (Md4.to_string c.client_md4);
       "client_name", string_to_value c.client_name;
-(*      "client_age", int_to_value (
-        CommonGlobals.connection_last_conn 
-        c.client_connection_control); *)
-(*      "client_last_filereqs", int_to_value c.client_last_filereqs; *)
     ]
   in
   
@@ -309,40 +284,11 @@
   let file = DonkeyGlobals.new_file file_diskname file_state
     (Md4.of_string file_md4) file_size filenames true in
 
-  (*
-  (try 
-      if file.file_exists then begin
-(* only load absent chunks if file previously existed. *)
-          file.file_absent_chunks <- 
-            get_value "file_absent_chunks" 
-            (value_to_list value_to_int32pair);
-        end
-    with _ -> ()                );
-*)
-  
-  
-  
   (try
       set_file_best_name (as_file file)
       (get_value "file_filename" value_to_string)
     with _ -> update_best_name file);
   
-(*
-  (try
-      let mtime = Unix32.mtime (file_disk_name file)  in
-      let old_mtime = value_to_float (List.assoc "file_mtime" assocs) in
-      file.file_mtime <- old_mtime;
-      let file_chunks = get_value "file_all_chunks" value_to_string in
-      file.file_chunks <- Array.init file.file_nchunks 
-        (fun i ->
-          let c = file_chunks.[i] in
-          if c = '0' then AbsentVerified else
-          if c = '2' then PresentVerified
-          else PresentTemp
-      )
-    with _ -> 
-        lprintf "Could not load chunks states\n"; );
-*)
   let md4s = try get_value "file_md4s" (value_to_array value_to_md4) 
     with _ -> [||] in
   
@@ -358,61 +304,17 @@
             Verification
             (Array.map (fun md4 -> Ed2k md4) md4s))
   );
-  
-(*
-  List.iter (fun c ->
-      DonkeyGlobals.new_source file  c;
-  )
-   (get_value_nil "file_locations" (value_to_list value_to_donkey_client)); *)
-  
-(*
-  (try
-      file.file_chunks_age <-
-        get_value "file_chunks_age" 
-        (fun v -> 
-          let list = value_to_list (fun v -> normalize_time (value_to_int v)) 
v in
-          Array.of_list list)
-    with _ -> ());
-  
-  file.file_file.impl_file_last_seen <- (
-    if file.file_chunks_age = [||]
-    then 0
-    else Array2.min file.file_chunks_age);
-*)
-  
   as_file file
   
-(*  
-let string_of_chunks file =
-  let nchunks = file.file_nchunks in
-  let s = String.make nchunks '0' in
-  for i = 0 to nchunks - 1 do
-    s.[i] <- (match file.file_chunks.(i) with
-      | PresentVerified -> '2'
-      | AbsentVerified 
-      | PartialVerified _ -> '0'
-      | _ -> '1' (* don't know ? *)
-    )
-  done;
-  s
-    *)
-
 let file_to_value file =
   let fields =
     [
       "file_md4", string_to_value (Md4.to_string file.file_md4);
       "file_diskname", string_to_value file.file_diskname;
-(*      "file_all_chunks", string_to_value (string_of_chunks file);   *)
-(*      "file_absent_chunks", List
-        (List.map (fun (i1,i2) -> 
-            SmallList [int64_to_value i1; int64_to_value i2])
-        file.file_absent_chunks); *)
       ("file_md4s", 
         array_to_value Md4.hash_to_value file.file_computed_md4s);
       "file_filenames", List
         (List.map (fun (s,_) -> string_to_value s) file.file_filenames);
-(*      "file_mtime", float_to_value (
-        try Unix32.mtime (file_disk_name file) with _ -> 0.0) *)
     ]
   in
   let fields = 
@@ -527,45 +429,6 @@
 let save_time = define_header_option file_sources_ini 
     ["save_time"] "" int_option (last_time ())
     
-      
-(*  
-let done_files = 
-  define_option files_ini ["done_files"] 
-  "The files whose download is finished" (list_option FileOption.t) []
-    *)
-
-module UidOption = struct
-    
-    let value_to_hash v = 
-      try
-        let uid = Uid.of_string (value_to_string v) in
-        ignore (Uid.to_uid uid);
-        uid
-      with _ -> Uid.create (Ed2k (Md4.value_to_hash v))
-            
-    let hash_to_value v = string_to_value (Uid.to_string v)
-      
-    let t =
-      define_option_class "Uid" value_to_hash hash_to_value
-    
-  end
-
-let brotherhood = 
-  define_option donkey_section ["brotherhood"] 
-    "The links between files being downloaded" (list_option 
-      (list_option Md4.option)) []
-
-  (*
-let files = 
-  define_option files_ini ["files"] 
-  "The files currently being downloaded" (list_option FileOption.t) []
-*)
-
-(*
-let known_servers = define_option servers_ini["known_servers"] "List of known 
servers"
-    (list_option ServerOption.t) []
-    *)
-
 let known_shared_files = define_option shared_section 
     ["shared_files"] "" 
     (list_option SharedFileOption.t) []
@@ -687,19 +550,6 @@
       lprintf ".";
       sources_loaded := true;
       lprintf " completed) ";
-      List.iter (fun list ->
-          let files = ref [] in
-          List.iter (fun m ->
-              try
-                let file = find_file m in
-                files := file.file_sources :: !files
-              with _ -> ()
-          ) list;
-          match !files with
-            [] | [_] -> ()
-          | files ->
-              DonkeySources.set_brothers files
-      ) !!brotherhood
     with _ -> ())
 
 let check_result r tags =
Index: mldonkey/src/networks/donkey/donkeyComplexOptions.mli
diff -u mldonkey/src/networks/donkey/donkeyComplexOptions.mli:1.10 
mldonkey/src/networks/donkey/donkeyComplexOptions.mli:1.11
--- mldonkey/src/networks/donkey/donkeyComplexOptions.mli:1.10  Wed Jan 11 
18:53:30 2006
+++ mldonkey/src/networks/donkey/donkeyComplexOptions.mli       Sat Apr  8 
02:16:21 2006
@@ -27,8 +27,6 @@
 val known_shared_files : DonkeyTypes.shared_file_info
   list Options.option_record
 
-val brotherhood : Md4.t list list Options.option_record
-
 val value_to_addr : Options.option_value -> Ip.t * int
 val value_to_md4 : Options.option_value -> Md4.t
 val file_to_value :  DonkeyTypes.file -> (string * Options.option_value) list
Index: mldonkey/src/networks/donkey/donkeyInteractive.ml
diff -u mldonkey/src/networks/donkey/donkeyInteractive.ml:1.97 
mldonkey/src/networks/donkey/donkeyInteractive.ml:1.98
--- mldonkey/src/networks/donkey/donkeyInteractive.ml:1.97      Sat Apr  8 
01:27:29 2006
+++ mldonkey/src/networks/donkey/donkeyInteractive.ml   Sat Apr  8 02:16:21 2006
@@ -736,27 +736,6 @@
         ""
     ), ":\t\t\t\t\tprint ID on connected servers";
 
-    "set_brothers", Arg_multiple (fun args o ->
-        let buf = o.conn_buf in
-
-        let files = ref [] in
-        List.iter (fun arg ->
-            let num = int_of_string arg in
-            List.iter (fun file ->
-                if file_num file = num then begin
-                    Printf.bprintf buf "%s\n" (file_best_name file);
-                    files := file :: !files
-                  end
-            ) !current_files
-        ) args;
-
-        DonkeySources.set_brothers
-          (List.map (fun file -> file.file_sources) !files);
-        brotherhood =:=
-          (List.map (fun file -> file.file_md4) !files) :: !!brotherhood;
-        "    are now defined as colocated"
-    ) , "<f1> < f2> ... :\t\tdefine these files as probably colocated";
-
     "recover_bytes", Arg_multiple (fun args o ->
         let buf = o.conn_buf in
 




reply via email to

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