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: Tue, 09 May 2006 08:40:25 +0000

CVSROOT:        /sources/mldonkey
Module name:    mldonkey
Branch:         
Changes by:     spiralvoice <address@hidden>    06/05/09 08:40:25

Modified files:
        distrib        : ChangeLog 
        src/daemon/common: commonOptions.ml 
        src/networks/fasttrack: fasttrackGlobals.ml fasttrackHandler.ml 
                                fasttrackProto.ml fasttrackServers.ml 
                                fst_crypt_ml.c 
        src/networks/gnutella: gnutellaMain.ml gnutellaServers.ml 

Log message:
        patch #5077

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/distrib/ChangeLog.diff?tr1=1.810&tr2=1.811&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/daemon/common/commonOptions.ml.diff?tr1=1.141&tr2=1.142&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/networks/fasttrack/fasttrackGlobals.ml.diff?tr1=1.32&tr2=1.33&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/networks/fasttrack/fasttrackHandler.ml.diff?tr1=1.17&tr2=1.18&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/networks/fasttrack/fasttrackProto.ml.diff?tr1=1.15&tr2=1.16&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/networks/fasttrack/fasttrackServers.ml.diff?tr1=1.27&tr2=1.28&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/networks/fasttrack/fst_crypt_ml.c.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/networks/gnutella/gnutellaMain.ml.diff?tr1=1.21&tr2=1.22&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/networks/gnutella/gnutellaServers.ml.diff?tr1=1.25&tr2=1.26&r1=text&r2=text

Patches:
Index: mldonkey/distrib/ChangeLog
diff -u mldonkey/distrib/ChangeLog:1.810 mldonkey/distrib/ChangeLog:1.811
--- mldonkey/distrib/ChangeLog:1.810    Sun May  7 20:50:11 2006
+++ mldonkey/distrib/ChangeLog  Tue May  9 08:40:25 2006
@@ -14,6 +14,10 @@
 ChangeLog
 =========
 
+2006/05/09
+5077: FT: Fix fasttrack connection problem and adds a bootstrap nodes file url
+      Removes old/broken imesh bootstrap node (zet)
+
 2006/05/07
 5076: Gd: Do not disable html_mods_vd_gfx if core is compiled without GD 
support
 5075: DNS round robin, keep all IP addresses associated with DNS names,
Index: mldonkey/src/daemon/common/commonOptions.ml
diff -u mldonkey/src/daemon/common/commonOptions.ml:1.141 
mldonkey/src/daemon/common/commonOptions.ml:1.142
--- mldonkey/src/daemon/common/commonOptions.ml:1.141   Fri May  5 22:41:54 2006
+++ mldonkey/src/daemon/common/commonOptions.ml Tue May  9 08:40:25 2006
@@ -181,21 +181,21 @@
       then begin
         if Sys.file_exists pid_filename then
           lprintf_nl "PID file %s exists."
-           (Filename.concat file_basedir pid_filename)
-       else
-         if Sys.file_exists config_space then begin
+      (Filename.concat file_basedir pid_filename)
+  else
+    if Sys.file_exists config_space then begin
             lprintf_nl "%s exists." (Filename.concat file_basedir 
config_space);
-           lprintf "%s" (exit_message config_space);
-           if Autoconf.windows then
-             begin
-               lprintf_nl "waiting 10 seconds to exit...";
-               Unix.sleep 10
-             end;
-           exit 2
-           end;
+      lprintf "%s" (exit_message config_space);
+      if Autoconf.windows then
+        begin
+          lprintf_nl "waiting 10 seconds to exit...";
+    Unix.sleep 10
+        end;
+      exit 2
+      end;
         let pid =
           try
-           Unix2.tryopen_read pid_filename (fun pid_ci ->
+      Unix2.tryopen_read pid_filename (fun pid_ci ->
               int_of_string (input_line pid_ci))
           with _ ->
             lprintf_nl "But it couldn't be read to check if the process still 
exists.";
@@ -204,23 +204,23 @@
         in
           try
             Unix.kill pid 0;
-           lprintf "%s" (exit_message pid_filename);
+      lprintf "%s" (exit_message pid_filename);
             exit 2
           with
             (* stalled pid file, disregard it *)
             | Unix.Unix_error (Unix.ESRCH, _, _) ->
-              (lprintf_nl "Removing stalled file %s " pid_filename;
-              try Sys.remove pid_filename with _ -> ())
-           | e -> 
-             lprintf "%s" (exit_message pid_filename);
-             if Autoconf.system = "mingw" then lprintf_nl
-               "can not check for stalled pid file because Unix.kill is not 
implemented on MinGW";
-             lprintf_nl "Exception %s, exiting..." (Printexc2.to_string e);
-             if Autoconf.system = "mingw" then begin
-               lprintf_nl "waiting 10 seconds to exit...";
-               Unix.sleep 10;
-             end;
-             exit 2
+         (lprintf_nl "Removing stalled file %s " pid_filename;
+         try Sys.remove pid_filename with _ -> ())
+      | e -> 
+        lprintf "%s" (exit_message pid_filename);
+        if Autoconf.system = "mingw" then lprintf_nl
+          "can not check for stalled pid file because Unix.kill is not 
implemented on MinGW";
+        lprintf_nl "Exception %s, exiting..." (Printexc2.to_string e);
+        if Autoconf.system = "mingw" then begin
+          lprintf_nl "waiting 10 seconds to exit...";
+    Unix.sleep 10;
+        end;
+        exit 2
       end;
 
   let filename =
@@ -836,6 +836,7 @@
     'guarding.p2p' for a blocklist file (also in gz/bz2/zip format), or
     'ocl' for file in the ocl format containing overnet peers, or
     'contact.dat' for an contact.dat file containing overnet peers,
+    'nodes.gzip' for a fasttrack nodes.gzip,
     and period is the period between updates (in hours),
     a period of zero means the file is only loaded once on startup,
     and url is the url of the file to download.
@@ -859,6 +860,8 @@
       "http://download.overnet.org/contact.dat";);
     ("geoip.dat", 0,
       "http://www.maxmind.com/download/geoip/database/GeoIP.dat.gz";);
+    ("nodes.gzip", 0,
+      "http://update.kceasy.com/update/fasttrack/nodes.gzip";);
 (*
     ("slsk_boot", 0,
       "http://www.slsknet.org/slskinfo2";);
@@ -1504,7 +1507,7 @@
 
 let options_version = define_expert_option current_section ["options_version"]
     "(internal option)"
-    int_option 12
+    int_option 13
 
 
 (*************************************************************************)
@@ -1628,18 +1631,18 @@
   option_hook log_file (fun _ ->
       if !!log_file <> "" then
         try
-         if Unix32.file_exists !!log_file then
-           if (Unix32.getsize !!log_file)
-            > (Int64ops.megabytes !!log_file_size) then begin
-             Sys.remove !!log_file;
+    if Unix32.file_exists !!log_file then
+      if (Unix32.getsize !!log_file)
+       > (Int64ops.megabytes !!log_file_size) then begin
+        Sys.remove !!log_file;
               lprintf_nl "Logfile %s reset: bigger than %d MB" !!log_file 
!!log_file_size
-           end;
+      end;
           let oc = open_out_gen [Open_creat; Open_wronly; Open_append] 0o644 
!!log_file in
           lprintf_to_file := true;
           if Autoconf.system = "cygwin" then lprintf "%s" win_message;
           lprintf_nl "Logging in %s" ( Filename.concat file_basedir 
!!log_file);
           log_to_file oc;
-         lprintf_nl "Started logging..."
+    lprintf_nl "Started logging..."
         with e ->
             lprintf_nl "Exception %s while opening log file: %s"
               (Printexc2.to_string e) !!log_file
@@ -1822,26 +1825,26 @@
       Buffer.contents result
     else match m.[i] with
       | '|' -> 
-         Buffer.add_string result "\\|";
-         aux (i+1)
+    Buffer.add_string result "\\|";
+    aux (i+1)
       | '\\' -> 
-         aux_escaped (i+1)
+    aux_escaped (i+1)
       | _ -> 
-         Buffer.add_char result m.[i];
-         aux (i+1)
+    Buffer.add_char result m.[i];
+    aux (i+1)
   and aux_escaped i =
     if i = len then begin
       Buffer.add_char result '\\';
       Buffer.contents result
     end else match m.[i] with
       | '|' -> 
-         Buffer.add_char result '|';
-         aux (i+1)
+    Buffer.add_char result '|';
+    aux (i+1)
       | _ ->
-         Buffer.add_char result '\\';
-         aux i
+    Buffer.add_char result '\\';
+    aux i
   in aux 0
-           
+      
 let _ =
   option_hook messages_filter (fun _ ->
       is_not_spam := if !!messages_filter <> "" then
@@ -1974,9 +1977,9 @@
       begin
         web_infos_remove
           [
-           ("server.met", 0, "http://www.gruk.org/server.met.gz";)
+      ("server.met", 0, "http://www.gruk.org/server.met.gz";)
           ];
-       web_infos_add "server.met" 0 "http://www.jd2k.com/server.met";;
+  web_infos_add "server.met" 0 "http://www.jd2k.com/server.met";;
       end;
       update 10
 
@@ -1985,10 +1988,10 @@
       begin
         web_infos_remove
           [
-           ("contact.dat", 672,
-             "http://www.overnet.org/download/contact.dat";);
+      ("contact.dat", 672,
+        "http://www.overnet.org/download/contact.dat";);
           ];
-       web_infos_add "contact.dat" 168 
"http://download.overnet.org/contact.dat";;
+  web_infos_add "contact.dat" 168 "http://download.overnet.org/contact.dat";;
       end;
       update 11
 
@@ -1997,11 +2000,15 @@
       begin
         web_infos_remove
           [
-           ("guarding.p2p", 96,
-             "http://www.bluetack.co.uk/config/antip2p.txt";);
+      ("guarding.p2p", 96,
+        "http://www.bluetack.co.uk/config/antip2p.txt";);
           ];
-       web_infos_add "guarding.p2p" 0 
"http://www.bluetack.co.uk/config/level1.gz";;
+  web_infos_add "guarding.p2p" 0 "http://www.bluetack.co.uk/config/level1.gz";;
       end;
       update 12
 
+  | 12 ->
+      web_infos_add "nodes.gzip" 0 
"http://update.kceasy.com/update/fasttrack/nodes.gzip";;
+      update 13
+
   | _ -> ()
Index: mldonkey/src/networks/fasttrack/fasttrackGlobals.ml
diff -u mldonkey/src/networks/fasttrack/fasttrackGlobals.ml:1.32 
mldonkey/src/networks/fasttrack/fasttrackGlobals.ml:1.33
--- mldonkey/src/networks/fasttrack/fasttrackGlobals.ml:1.32    Sun Apr  9 
00:27:04 2006
+++ mldonkey/src/networks/fasttrack/fasttrackGlobals.ml Tue May  9 08:40:25 2006
@@ -98,6 +98,8 @@
   file_must_update (as_file file)
 let server_num s =
   server_num (as_server s.server_server)
+let server_must_update s =
+  server_must_update (as_server s.server_server)
 let server_state s =
   server_state (as_server s.server_server)
 let set_server_state s state =
@@ -399,7 +401,7 @@
           dummy_client_impl with
           impl_client_val = c;
           impl_client_ops = client_ops;
-         impl_client_upload = None;
+    impl_client_upload = None;
         } in
       new_client impl;
       Hashtbl.add clients_by_uid kind c;
Index: mldonkey/src/networks/fasttrack/fasttrackHandler.ml
diff -u mldonkey/src/networks/fasttrack/fasttrackHandler.ml:1.17 
mldonkey/src/networks/fasttrack/fasttrackHandler.ml:1.18
--- mldonkey/src/networks/fasttrack/fasttrackHandler.ml:1.17    Wed Dec 14 
21:17:46 2005
+++ mldonkey/src/networks/fasttrack/fasttrackHandler.ml Tue May  9 08:40:25 2006
@@ -227,6 +227,7 @@
               s.server_nusers <- stats.TcpMessages.nusers;
               s.server_nfiles <- stats.TcpMessages.nfiles;
               s.server_nkb <- stats.TcpMessages.nkb;
+              server_must_update s;
         end
 
     | M.NetworkNameReq netname ->
Index: mldonkey/src/networks/fasttrack/fasttrackProto.ml
diff -u mldonkey/src/networks/fasttrack/fasttrackProto.ml:1.15 
mldonkey/src/networks/fasttrack/fasttrackProto.ml:1.16
--- mldonkey/src/networks/fasttrack/fasttrackProto.ml:1.15      Thu Dec 15 
19:41:46 2005
+++ mldonkey/src/networks/fasttrack/fasttrackProto.ml   Tue May  9 08:40:25 2006
@@ -990,7 +990,7 @@
             let my_port = get_int16 m 4 in
 
             let bandwidth = get_int8 m 6 in
-(*         let next_byte = get_int8 m 7 in *)
+(*      let next_byte = get_int8 m 7 in *)
             let client_name = String.sub m 8 (String.length m - 8) in
 
             NodeInfoReq (my_ip, my_port, bandwidth, client_name)
@@ -1892,17 +1892,17 @@
       let cipher = create_cipher () in
       set_cipher cipher 123456789l 0x29;
       init_cipher cipher;
-      let s = String.create 12 in
+      let s = String.make 12 '0' in
       cipher_packet_set cipher s 0;
-      assert (s = "ú\000¶+\007[Í\021né\135»");
-      lprintf "cipher_packet_set s = \"%s\"\n" (String.escaped s);
+      assert (s = "\007\091\205\021\110\233\135\1870000"); 
+      (* lprintf "cipher_packet_set s = \"%s\"\n" (String.escaped s); *)
       let s = "123456789abcdefghijklm\233\234\235" in
       apply_cipher cipher s 0 (String.length s);
-      assert (s = "\016Òõñ\144Ug\028ZåÀ8°§À\008\139\019\018ZÁ7âúi");
-      lprintf "apply_cipher s = \"%s\"\n" (String.escaped s);
+      assert (s = 
"\016\210\245\241\144Ug\028Z\229\1928\176\167\192\008\139\019\018Z\1937\226\250i");
 
+      (* lprintf "apply_cipher s = \"%s\"\n" (String.escaped s); *)
       cipher_free cipher;
     with _ ->
-       lprint_newline ();
+  lprint_newline ();
         lprintf "The Fasttrack plugin will not work on your computer, since\n";
         lprintf "the encryption algorithm does not work correctly.\n";
         lprintf "You can try to solve this problem by hacking the C files 
in\n";
@@ -1947,10 +1947,10 @@
           | Field_Completesources
           | Field_Length
           | Field_Availability
-         | Field_Filerating
-         | Field_Lastseencomplete
-         | Field_Mediacodec
-         | Field_Medialength
+    | Field_Filerating
+    | Field_Lastseencomplete
+    | Field_Mediacodec
+    | Field_Medialength
           | Field_Size -> ()
         end
     | QHasMinVal (field, value) ->
Index: mldonkey/src/networks/fasttrack/fasttrackServers.ml
diff -u mldonkey/src/networks/fasttrack/fasttrackServers.ml:1.27 
mldonkey/src/networks/fasttrack/fasttrackServers.ml:1.28
--- mldonkey/src/networks/fasttrack/fasttrackServers.ml:1.27    Wed Jan 11 
19:12:35 2006
+++ mldonkey/src/networks/fasttrack/fasttrackServers.ml Tue May  9 08:40:25 2006
@@ -45,10 +45,51 @@
 open FasttrackComplexOptions
 open FasttrackProto
 
-let bootstrap_from_imesh = define_option fasttrack_section
-  ["bootstrap_from_imesh"]
-  "(only for development tests)"
-    bool_option true
+let load_nodes_file filename = 
+  let regexp = Str.regexp "^\\([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+\\) 
\\([0-9]+\\) .*$" in
+  Unix2.tryopen_read filename (fun cin ->
+    try
+    
+      while true do
+        let line = input_line cin in
+        try 
+          if Str.string_match regexp line 0 then 
+            let ip = Ip.addr_of_string (Str.matched_group 1 line) in
+            let port = int_of_string (Str.matched_group 2 line) in
+            try
+              ignore (H.new_host ip port Ultrapeer)
+            with Not_found -> ()
+        with _ ->
+          lprintf_nl () "Syntax error in %s" filename;
+      done
+    
+    with End_of_file -> ()
+  )
+
+let unpack_nodes_gzip filename url =
+  let ext = String.lowercase (Filename2.extension filename) in
+  let last_ext = String.lowercase (Filename2.last_extension filename) in
+  let real_ext = if last_ext = ".zip" then last_ext else ext in
+    match real_ext with
+    | ".gzip" -> (
+         try     
+            Misc.archive_extract filename "gz"
+         with e ->
+          lprintf_nl () "Exception %s while extracting from %s" 
(Printexc2.to_string e) url;
+          raise Not_found
+      )
+    | _ -> filename
+
+let _ =
+    CommonWeb.add_web_kind "nodes.gzip" "List of fasttrack nodes"
+    (fun url filename -> 
+        lprintf_nl () "nodes.gzip loaded from %s" url;
+        try
+          let f = unpack_nodes_gzip filename url in
+          load_nodes_file f;
+          if f <> filename then Sys.remove f;
+        with _ -> () 
+    )    
 
 let server_parse_after s gconn sock =
   try
@@ -382,14 +423,6 @@
     h
   with _ -> find_ultrapeer queue
 
-let ft_boot () =
-  let imesh_ip = Ip.addr_of_string "fm2.imesh.com" in
-  let (h : host) =
-    if !verbose then lprintf_nl () "Bootstrapping from Imesh %s" 
(Ip.string_of_addr imesh_ip);
-    H.new_host imesh_ip 1214 IndexServer
-  in
-  connect_server h
-
 let try_connect_ultrapeer connect =
 (*  lprintf "try_connect_ultrapeer....\n"; *)
   let h =
@@ -397,13 +430,7 @@
       find_ultrapeer ultrapeers_waiting_queue
     with _ ->
 (*        lprintf "not in ultrapeers_waiting_queue\n";   *)
-        if !!bootstrap_from_imesh then
-         let imesh_ip = Ip.addr_of_string "fm2.imesh.com" in
-          let (_ : host) =
-           if !verbose then lprintf_nl () "Bootstrapping from Imesh %s" 
(Ip.string_of_addr imesh_ip);
-            H.new_host (Ip.addr_of_string "fm2.imesh.com") 1214 IndexServer in
-          find_ultrapeer peers_waiting_queue
-        else raise Not_found
+       raise Not_found
   in
 (*  lprintf "contacting..\n";  *)
   connect h
Index: mldonkey/src/networks/fasttrack/fst_crypt_ml.c
diff -u mldonkey/src/networks/fasttrack/fst_crypt_ml.c:1.7 
mldonkey/src/networks/fasttrack/fst_crypt_ml.c:1.8
--- mldonkey/src/networks/fasttrack/fst_crypt_ml.c:1.7  Mon Aug  1 23:53:54 2005
+++ mldonkey/src/networks/fasttrack/fst_crypt_ml.c      Tue May  9 08:40:25 2006
@@ -94,6 +94,11 @@
 
   out_cipher->seed ^= in_cipher->seed; /* xor send cipher with received seed */
 
+  /* the correct behaviour here is to use the enc_type the supernode sent
+   * us for out_cipher too.
+   */
+  out_cipher->enc_type = in_cipher->enc_type;
+
   return Val_unit;
 }
 
Index: mldonkey/src/networks/gnutella/gnutellaMain.ml
diff -u mldonkey/src/networks/gnutella/gnutellaMain.ml:1.21 
mldonkey/src/networks/gnutella/gnutellaMain.ml:1.22
--- mldonkey/src/networks/gnutella/gnutellaMain.ml:1.21 Wed Dec 14 21:17:47 2005
+++ mldonkey/src/networks/gnutella/gnutellaMain.ml      Tue May  9 08:40:25 2006
@@ -107,7 +107,7 @@
     );
     
     GnutellaServers.ask_for_files ();
-    
+
     add_session_timer enabler 60.0 (fun timer ->
         GnutellaServers.ask_for_files ();
         GnutellaServers.send_pings ();
@@ -122,8 +122,6 @@
           end
     );
 
-    add_timer 10. (fun _ -> try GnutellaServers.ft_boot () with _ -> ());    
-
     GnutellaInteractive.recover_files ();
     add_session_timer enabler GnutellaProto.recover_files_delay (fun timer ->
         GnutellaInteractive.recover_files ();
Index: mldonkey/src/networks/gnutella/gnutellaServers.ml
diff -u mldonkey/src/networks/gnutella/gnutellaServers.ml:1.25 
mldonkey/src/networks/gnutella/gnutellaServers.ml:1.26
--- mldonkey/src/networks/gnutella/gnutellaServers.ml:1.25      Fri May  5 
22:08:01 2006
+++ mldonkey/src/networks/gnutella/gnutellaServers.ml   Tue May  9 08:40:25 2006
@@ -776,8 +776,6 @@
 (*                                                                       *)
 (*************************************************************************)
 
-let ft_boot () = ()
-     
 let _ =
   server_ops.op_server_disconnect <- 
   (fun s -> disconnect_server s Closed_by_user);




reply via email to

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