mldonkey-commits
[Top][All Lists]
Advanced

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

[Mldonkey-commits] mldonkey/src daemon/common/commonComplexOptions...


From: mldonkey-commits
Subject: [Mldonkey-commits] mldonkey/src daemon/common/commonComplexOptions...
Date: Fri, 14 Jul 2006 13:24:24 +0000

CVSROOT:        /sources/mldonkey
Module name:    mldonkey
Changes by:     spiralvoice <spiralvoice>       06/07/14 13:24:24

Modified files:
        src/daemon/common: commonComplexOptions.ml commonInteractive.ml 
                           commonOptions.ml commonWeb.ml 
        src/daemon/driver: driverControlers.ml driverInteractive.ml 
                           driverMain.ml 
        src/networks/donkey: donkeyInteractive.ml 
        src/utils/lib  : gettext.ml4 
        src/utils/net  : geoip.ml ip.ml ip_set.ml 

Log message:
        patch #5214

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/common/commonComplexOptions.ml?cvsroot=mldonkey&r1=1.56&r2=1.57
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/common/commonInteractive.ml?cvsroot=mldonkey&r1=1.73&r2=1.74
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/common/commonOptions.ml?cvsroot=mldonkey&r1=1.159&r2=1.160
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/common/commonWeb.ml?cvsroot=mldonkey&r1=1.32&r2=1.33
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/driver/driverControlers.ml?cvsroot=mldonkey&r1=1.74&r2=1.75
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/driver/driverInteractive.ml?cvsroot=mldonkey&r1=1.88&r2=1.89
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/driver/driverMain.ml?cvsroot=mldonkey&r1=1.116&r2=1.117
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/networks/donkey/donkeyInteractive.ml?cvsroot=mldonkey&r1=1.110&r2=1.111
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/utils/lib/gettext.ml4?cvsroot=mldonkey&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/utils/net/geoip.ml?cvsroot=mldonkey&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/utils/net/ip.ml?cvsroot=mldonkey&r1=1.24&r2=1.25
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/utils/net/ip_set.ml?cvsroot=mldonkey&r1=1.27&r2=1.28

Patches:
Index: daemon/common/commonComplexOptions.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonComplexOptions.ml,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -b -r1.56 -r1.57
--- daemon/common/commonComplexOptions.ml       11 Jun 2006 17:32:27 -0000      
1.56
+++ daemon/common/commonComplexOptions.ml       14 Jul 2006 13:24:23 -0000      
1.57
@@ -29,6 +29,10 @@
 open CommonOptions
 open CommonTypes
 open CommonFile
+open Gettext
+
+let _s x = _s "CommonComplexOptions" x
+let _b x = _b "CommonComplexOptions" x
 
 let log_prefix = "[cCO]"
 
@@ -965,13 +969,13 @@
         Options.save_with_help results_ini;
         results =:= [];
     end;
-  lprintf_nl "Options correctly saved"
+  lprintf_nl (_b "Options correctly saved")
   end
 
 let save_sources () =
   if !allow_saving_ini_files then begin
   networks_iter (fun n -> network_save_sources n);
-  lprintf_nl "Sources correctly saved"
+  lprintf_nl (_b "Sources correctly saved")
   end
 
 open Zip
@@ -1077,7 +1081,7 @@
       end
     with e -> lprintf_nl "Exception %s while options backup" 
(Printexc2.to_string e); raise e
   end;
-  lprintf_nl "Options backup as %s correctly saved" format
+  lprintf_nl (_b "Options backup as %s correctly saved") format
              
 let _ =
   CommonBlocking.add_update_hook CommonServer.check_blocked_servers;

Index: daemon/common/commonInteractive.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonInteractive.ml,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -b -r1.73 -r1.74
--- daemon/common/commonInteractive.ml  29 Jun 2006 15:58:53 -0000      1.73
+++ daemon/common/commonInteractive.ml  14 Jul 2006 13:24:23 -0000      1.74
@@ -560,11 +560,11 @@
            if use_html_mods o then begin
                Printf.bprintf buf "\\<div class=servers\\>";
                html_mods_table_one_row buf "serversTable" "servers" [
-                 ("", "srh", Printf.sprintf "--- Connected to %d servers on 
the %s network ---\n"
+                 ("", "srh", Printf.sprintf (_b "--- Connected to %d servers 
on the %s network ---\n")
                    (List.length list) r.network_name); ]
              end
            else
-             Printf.bprintf buf "--- Connected to %d servers on the %s network 
---\n"
+             Printf.bprintf buf (_b "--- Connected to %d servers on the %s 
network ---\n")
                (List.length list) r.network_name;
            if use_html_mods o then Printf.bprintf buf "\\</div\\>";
           end;
@@ -579,8 +579,8 @@
         if Autoconf.donkey = "yes" && r.network_name = "Donkey" && not 
!!enable_servers then
           begin
             if use_html_mods o then Printf.bprintf buf "\\<div 
class=servers\\>";
-            Printf.bprintf buf "You disabled server usage, therefore you are 
not able to connect ED2K servers.\n";
-            Printf.bprintf buf "To use servers again 'set enable_servers 
true'\n";
+            Printf.bprintf buf (_b "You disabled server usage, therefore you 
are not able to connect ED2K servers.\n");
+            Printf.bprintf buf (_b "To use servers again 'set enable_servers 
true'\n");
             if use_html_mods o then Printf.bprintf buf "\\</div\\>"
           end;
        with e ->

Index: daemon/common/commonOptions.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonOptions.ml,v
retrieving revision 1.159
retrieving revision 1.160
diff -u -b -r1.159 -r1.160
--- daemon/common/commonOptions.ml      14 Jul 2006 13:15:39 -0000      1.159
+++ daemon/common/commonOptions.ml      14 Jul 2006 13:24:23 -0000      1.160
@@ -25,6 +25,8 @@
 open Options
 open Unix
 
+let _s x = _s "CommonOptions" x
+let _b x = _b "CommonOptions" x
 
 let startup_message = ref ""
 
@@ -147,6 +149,15 @@
   Unix2.can_write_to_directory file_basedir;
   Unix.chdir file_basedir;
   
+  let filename =
+    try
+      Sys.getenv "MLDONKEY_STRINGS"
+    with _ ->
+        "mlnet_strings"
+  in
+  set_strings_file filename;
+  lprintf_nl (_b "loaded language resource file");
+
   let uname = Unix32.uname () in
   if uname = "" then
     begin
@@ -155,7 +166,7 @@
     end
   else
     if not (Unix32.os_supported ()) then begin
-      lprintf_nl "WARNING: MLDonkey is not suuported on %s" uname;
+      lprintf_nl "WARNING: MLDonkey is not supported on %s" uname;
       if Autoconf.windows then
         lprintf_nl "WARNING: MLDonkey is only supported on Windows 
NT/2000/XP/Server 2003."
     end;
@@ -243,18 +254,7 @@
          if Autoconf.windows then windows_sleep 10;
          exit 2
     end
-  end;
-  let filename =
-    try
-      Sys.getenv "MLDONKEY_STRINGS"
-    with _ ->
-      "mlnet_strings"
-  in
-  set_strings_file filename
-
-
-let _s x = _s "CommonOptions" x
-let _b x = _b "CommonOptions" x
+  end
 
 let define_option a b ?desc c d e =
   match desc with
@@ -1615,12 +1615,12 @@
       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
+              lprintf_nl (_b "Logfile %s reset: bigger than %d MB") !!log_file 
!!log_file_size
       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);
+          lprintf_nl (_b "Logging in %s") ( Filename.concat file_basedir 
!!log_file);
           log_to_file oc;
     lprintf_nl "Started logging..."
         with e ->

Index: daemon/common/commonWeb.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonWeb.ml,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -b -r1.32 -r1.33
--- daemon/common/commonWeb.ml  1 Jun 2006 01:41:11 -0000       1.32
+++ daemon/common/commonWeb.ml  14 Jul 2006 13:24:23 -0000      1.33
@@ -29,6 +29,18 @@
 open CommonGlobals
 open CommonOptions
 open CommonTypes
+open Gettext
+
+let _s x = _s "CommonWeb" x
+let _b x = _b "CommonWeb" x
+
+let log_prefix = "[cWeb]"
+
+let lprintf_nl fmt =
+  lprintf_nl2 log_prefix fmt
+
+let lprintf_n fmt =
+  lprintf2 log_prefix fmt
 
 let days = ref 0
 let hours = ref 0
@@ -108,18 +120,18 @@
            let file_time = Unix.gmtime file_date.Unix.LargeFile.st_mtime in
              if html_time <= file_time then
                begin
-               lprintf_nl "[cWeb] using local version of %s, HTML header (%s)" 
file date;
+               lprintf_nl (_b "using local version of %s, HTML header (%s)") 
file date;
                (f file : unit)
                end
              else
                begin
-                 lprintf_nl "[cWeb] downloading newer %s, HTML header (%s)" 
file date;
+                 lprintf_nl (_b "downloading newer %s, HTML header (%s)") file 
date;
                  H.wget r f
                end
          end
       )
     with e -> 
-      lprintf_nl "[cWeb] Exception %s while loading %s"
+      lprintf_nl (_b "Exception %s while loading %s")
         (Printexc2.to_string e) url
     end
 
@@ -130,21 +142,21 @@
     with e -> failwith (Printf.sprintf "Unknown kind [%s]" kind)
   in
   try
-    lprintf_nl "[cWeb=%s] saving %s" kind url;
+    lprintf_nl (_b "saving %s (%s)") kind url;
     mldonkey_wget url f
   with e ->
     if can_fail then
       failwith (Printf.sprintf "Exception %s while loading %s"
           (Printexc2.to_string e) url)
     else
-      lprintf_nl "[cWeb] Exception %s while loading %s"
+      lprintf_nl (_b "Exception %s while loading %s")
           (Printexc2.to_string e) url
 
 let load_file kind file =
   try
     (List.assoc kind !file_kinds).f file file
   with e ->
-      lprintf_nl "[cWeb] Exception %s while loading kind %s"
+      lprintf_nl (_b "Exception %s while loading kind %s")
         (Printexc2.to_string e) kind
 
 (*************************************************************************)
@@ -160,7 +172,7 @@
         try
           load_url false kind url
        with e ->
-            lprintf_nl "[cWeb] %s while loading %s"
+            lprintf_nl (_b "%s while loading %s")
              (Printexc2.to_string e) url
       end
   ) !!CommonOptions.web_infos
@@ -176,7 +188,7 @@
 let _ =
   add_web_kind "rss" "Syndication feeds to get periodically updated data" 
     (fun url filename ->
-      lprintf_nl "[cWeb=rss] parsing feed %s" url;
+      lprintf_nl (_b "parsing feed %s (rss)") url;
       let c = Rss.channel_of_file filename in
       (try Sys.remove filename with _ -> ());
       let feed =

Index: daemon/driver/driverControlers.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/driver/driverControlers.ml,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -b -r1.74 -r1.75
--- daemon/driver/driverControlers.ml   27 Jun 2006 10:38:35 -0000      1.74
+++ daemon/driver/driverControlers.ml   14 Jul 2006 13:24:24 -0000      1.75
@@ -1081,7 +1081,8 @@
 
         | "oneframe.html" ->
             html_open_page buf t r true;
-            Buffer.add_string buf (Printf.sprintf "<br><div 
align=\"center\"><h3>Welcome to MLDonkey %s</h3></div>" 
Autoconf.current_version);
+            Buffer.add_string buf (Printf.sprintf "<br><div 
align=\"center\"><h3>%s %s</h3></div>"
+             (Printf.sprintf (_b "Welcome to MLDonkey")) 
Autoconf.current_version);
            (match DriverInteractive.real_startup_message () with
               Some s -> Buffer.add_string buf (Printf.sprintf 
"<p><pre><b><h3>%s</b></h3></pre>" s);
             | None -> ())

Index: daemon/driver/driverInteractive.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/driver/driverInteractive.ml,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -b -r1.88 -r1.89
--- daemon/driver/driverInteractive.ml  14 Jul 2006 13:17:52 -0000      1.88
+++ daemon/driver/driverInteractive.ml  14 Jul 2006 13:24:24 -0000      1.89
@@ -54,7 +54,7 @@
     if user2_password admin_user = blank_password then
       empty_pwd := true
     with e ->
-      lprintf_nl "SECURITY INFO: user 'admin' has to be present, creating...";
+      lprintf_nl (_b "SECURITY INFO: user 'admin' has to be present, 
creating...");
       empty_pwd := true;
       ignore (user2_add admin_user blank_password "")
   end;
@@ -809,7 +809,7 @@
 end
 else
   html_mods_table_one_row buf "downloaderTable" "downloaders" [
-    ("", "srh", "!! No files, please use search or the dllink <url> command to 
add a new download !!"); ]
+    ("", "srh", (Printf.sprintf (_b "!! No files, please use search or the 
dllink <url> command to add a new download !!"))); ]
 
 let html_mods_done_files buf files =
 

Index: daemon/driver/driverMain.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/driver/driverMain.ml,v
retrieving revision 1.116
retrieving revision 1.117
diff -u -b -r1.116 -r1.117
--- daemon/driver/driverMain.ml 14 Jul 2006 13:15:39 -0000      1.116
+++ daemon/driver/driverMain.ml 14 Jul 2006 13:24:24 -0000      1.117
@@ -500,37 +500,35 @@
 
   if not Autoconf.windows then
     MlUnix.set_signal  Sys.sigchld
-      (Sys.Signal_handle (fun _ -> if !verbose then lprintf_nl "Received 
SIGCHLD, doing nothing"));
+      (Sys.Signal_handle (fun _ -> if !verbose then lprintf_nl (_b "Received 
SIGCHLD, doing nothing")));
 
   if not Autoconf.windows then
     MlUnix.set_signal  Sys.sighup
-      (Sys.Signal_handle (fun _ ->
-   lprintf_nl "Received SIGHUP, closing all files/sockets";
+      (Sys.Signal_handle (fun _ -> lprintf_nl (_b "Received SIGHUP, closing 
all files/sockets");
          BasicSocket.close_all ();
         Unix32.close_all ()
          ));
 
   if not Autoconf.windows then
     MlUnix.set_signal  Sys.sigpipe
-      (Sys.Signal_handle (fun _ -> if !verbose then lprintf_nl "Received 
SIGPIPE, doing nothing"));
+      (Sys.Signal_handle (fun _ -> if !verbose then lprintf_nl (_b "Received 
SIGPIPE, doing nothing")));
 
   MlUnix.set_signal  Sys.sigint
-    (Sys.Signal_handle (fun _ -> lprintf_nl "Received SIGINT, stopping 
MLDonkey...";
+    (Sys.Signal_handle (fun _ -> lprintf_nl (_b "Received SIGINT, stopping 
MLDonkey...");
         CommonInteractive.clean_exit 0));
 
   MlUnix.set_signal  Sys.sigterm
-    (Sys.Signal_handle (fun _ -> lprintf_nl "Received SIGTERM, stopping 
MLDonkey...";
+    (Sys.Signal_handle (fun _ -> lprintf_nl (_b "Received SIGTERM, stopping 
MLDonkey...");
         CommonInteractive.clean_exit 0));
 
   if not Autoconf.windows then
   MlUnix.set_signal  Sys.sigusr1
-    (Sys.Signal_handle (fun _ -> lprintf_nl "Received SIGUSR1, saving 
options...";
+    (Sys.Signal_handle (fun _ -> lprintf_nl (_b "Received SIGUSR1, saving 
options...");
         DriverInteractive.save_config ()));
 
   if not Autoconf.windows then
   MlUnix.set_signal  Sys.sigusr2
-    (Sys.Signal_handle (fun _ ->
-  lprintf_n "Received SIGUSR2, starting garbage collection...";
+    (Sys.Signal_handle (fun _ -> lprintf_n (_b "Received SIGUSR2, starting 
garbage collection...");
        Gc.compact ();
        lprintf " finished";
        lprint_newline ()));

Index: networks/donkey/donkeyInteractive.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/donkey/donkeyInteractive.ml,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -b -r1.110 -r1.111
--- networks/donkey/donkeyInteractive.ml        27 Jun 2006 10:38:37 -0000      
1.110
+++ networks/donkey/donkeyInteractive.ml        14 Jul 2006 13:24:24 -0000      
1.111
@@ -55,6 +55,11 @@
 open DonkeyStats
 open DonkeyUdp
 
+open Gettext
+
+let _s x = _s "DonkeyInteractive" x
+let _b x = _b "DonkeyInteractive" x
+
 module VB = VerificationBitmap
 
 let result_name r =
@@ -125,16 +130,16 @@
              Unix2.tryopen_read_zip filename (fun ic ->
                try
                  let file = Zip.find_entry ic "server.met" in
-      lprintf_nl "server.met found in %s" url;
+                   lprintf_nl (_b "server.met found in %s") url;
                  file.Zip.filename
                with e ->
-      lprintf_nl "Exception %s while extracting server.met from %s"
+                   lprintf_nl (_b "Exception %s while extracting server.met 
from %s")
                    (Printexc2.to_string e) url;
                  raise e) in
            (try
              ignore(Misc.archive_extract filename "zip")
            with e ->
-        lprintf_nl "Exception %s while extracting server.met from %s"
+               lprintf_nl (_b "Exception %s while extracting server.met from 
%s")
                (Printexc2.to_string e) url;
              raise e);
            result
@@ -170,18 +175,18 @@
         let s = unpack_server_met filename url in
     let n = load_server_met s in
       if s <> filename then Sys.remove s;
-            lprintf_nl "server.met loaded from %s, %d servers found, %d new 
ones inserted"
+            lprintf_nl (_b "server.met loaded from %s, %d servers found, %d 
new ones inserted")
         url n ((List.length (Hashtbl2.to_list servers_by_key)) - nservers)
       with e -> ()
     )
 
-let already_done = Failure "File already downloaded (use 'force_download' if 
necessary)"
+let already_done = Failure (Printf.sprintf (_b "File already downloaded (use 
'force_download' if necessary)"))
 
-let no_download_to_force = Failure "No forceable download found"
+let no_download_to_force = Failure (Printf.sprintf (_b "No forceable download 
found"))
 
-let already_downloading = Failure "File is already in download queue"
+let already_downloading = Failure (Printf.sprintf (_b "File is already in 
download queue"))
 
-let already_shared = Failure "File is already shared"
+let already_shared = Failure (Printf.sprintf (_b "File is already shared"))
 
 let really_query_download filenames size md4 location old_file absents =
 
@@ -241,7 +246,7 @@
             CommonSwarming.set_absent swarmer absents
   end;
 
-  if !verbose then lprintf_nl "Started new download, file %s, size %Ld, md4 %s"
+  if !verbose then lprintf_nl (_b "Started new download, file %s, size %Ld, 
md4 %s")
     (file_best_name file) size (Md4.to_string md4);
 
   DonkeyProtoOvernet.Overnet.recover_file file;
@@ -516,7 +521,7 @@
   | "file" :: name :: size :: md4 :: "/" :: "sources" :: sources :: _ ->
 (*  
ed2k://|file|Wikipedia_3.3_noimages.iso|2666311680|747735CD46B61DA92973E9A8840A9C99|/|sources,62.143.4.124:4662|/
  *)
       if Int64.of_string size >= 4294967295L then
-       "Files > 4GB are not allowed", false
+       (Printf.sprintf (_b "Files > 4GB are not allowed")), false
       else
         begin
          let md4 = if String.length md4 > 32 then
@@ -544,7 +549,7 @@
                  List.iter (fun (source_ip, source_port) ->
                    add_source new_file source_ip source_port Ip.null 0
                  ) !new_sources;
-                 (Printf.sprintf "added %d sources to new download" 
(List.length !new_sources)), true
+                 (Printf.sprintf (_b "added %d sources to new download") 
(List.length !new_sources)), true
                end
              else "", true
            with e -> (Printexc2.to_string e), false
@@ -553,7 +558,7 @@
   | "ed2k://" :: "file" :: name :: size :: md4 :: _
   | "file" :: name :: size :: md4 :: _ ->
       if Int64.of_string size >= 4294967295L then
-       "Files > 4GB are not allowed", false
+       (Printf.sprintf (_b "Files > 4GB are not allowed")), false
       else
         let md4 = if String.length md4 > 32 then
           String.sub md4 0 32 else md4 in

Index: utils/lib/gettext.ml4
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/utils/lib/gettext.ml4,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- utils/lib/gettext.ml4       3 Apr 2006 20:50:09 -0000       1.6
+++ utils/lib/gettext.ml4       14 Jul 2006 13:24:24 -0000      1.7
@@ -339,10 +339,7 @@
             Hashtbl.iter (fun modname names ->
 
                 Printf.fprintf oc "(************************************)\n";
-                Printf.fprintf oc "(*                                  *)\n";
-                Printf.fprintf oc "\n         module \"%s\"\n\n"
-                  (String.escaped modname);
-                Printf.fprintf oc "(*                                  *)\n";
+                Printf.fprintf oc "         module \"%s\"\n" (String.escaped 
modname);
                 Printf.fprintf oc "(************************************)\n\n";
 
                 
@@ -398,6 +395,7 @@
 (*lprintf "Loading...\n"; *)
   (try
     Unix2.tryopen_read filename (fun ic ->
+      lprintf_nl "Loading language resource %s" filename;
       let s = Stream.of_channel ic in
       try
         let stream = lexer s in

Index: utils/net/geoip.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/utils/net/geoip.ml,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- utils/net/geoip.ml  3 Apr 2006 20:50:09 -0000       1.5
+++ utils/net/geoip.ml  14 Jul 2006 13:24:24 -0000      1.6
@@ -22,6 +22,10 @@
 open Ip
 open Int64ops
 open Printf2
+open Gettext
+
+let _s x = _s "GeoIp" x
+let _b x = _b "GeoIp" x
 
 let country_begin = 16776960
 let state_begin_rev0 = 16700000
@@ -260,7 +264,7 @@
     end;
 
     active := true; 
-    lprintf_nl "[GeoIP] database loaded"
+    lprintf_nl (_b "[GeoIP] database loaded")
   with _ -> 
     active := false
 

Index: utils/net/ip.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/utils/net/ip.ml,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -b -r1.24 -r1.25
--- utils/net/ip.ml     29 Jun 2006 15:56:44 -0000      1.24
+++ utils/net/ip.ml     14 Jul 2006 13:24:24 -0000      1.25
@@ -19,8 +19,13 @@
 
 (* This module uses 2 ints to save IPv4 numbers. *)
 
+open Gettext
 open Int64ops
 open Printf2
+
+let _s x = _s "Ip" x
+let _b x = _b "Ip" x
+
 type t = { hi: int; lo: int }
 
 let of_ints (a,b,c,d) = 
@@ -205,7 +210,7 @@
       cache_entry
   with Not_found ->
     (* not in cache *)
-    lprintf_nl "[DNS] Resolving [%s] ..." name;
+    lprintf_nl (_b "[DNS] Resolving [%s] ...") name;
     let new_entry =
       make_entry_from_name ~time_limit:(current_time +. 3600.) name in
     Hashtbl.add ip_cache name new_entry;
@@ -336,7 +341,7 @@
 (*        lprintf "Ip found for %s: %s\n" job.name (to_string ip);  *)
               job.handler ip
             end else begin
-              lprintf_nl "[DNS] could not resolve %s, check URL" job.name;
+              lprintf_nl (_b "[DNS] could not resolve %s, check URL") job.name;
               raise Not_found
             end
           end else raise Exit

Index: utils/net/ip_set.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/utils/net/ip_set.ml,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- utils/net/ip_set.ml 19 May 2006 23:43:55 -0000      1.27
+++ utils/net/ip_set.ml 14 Jul 2006 13:24:24 -0000      1.28
@@ -1,6 +1,10 @@
 
 open Printf2
 open Ip
+open Gettext
+
+let _s x = _s "Ip_set" x
+let _b x = _b "Ip_set" x
 
 (* prints a new logline with date, module and starts newline *)
 let log_prefix = "[IPblock]"
@@ -215,7 +219,7 @@
   if !error then lprint_newline ();
   if remove then (try Sys.remove filename with _ -> ());
   let optimized_bl = bl_optimize !bl in
-  lprintf_nl "%d ranges loaded - optimized to %d" !nranges (bl_length 
optimized_bl);
+  lprintf_nl (_b "%d ranges loaded - optimized to %d") !nranges (bl_length 
optimized_bl);
 (*    bl_optimizedp optimized_bl;
     for i=0 to 999999 do
       let random_ip = Ip.of_ints (Random.int 256, Random.int 256, Random.int 
256, Random.int 256) in
@@ -227,7 +231,7 @@
   optimized_bl
 
 let load filename =
-  lprintf_nl "loading %s" filename;
+  lprintf_nl (_b "loading %s") filename;
   if Sys.file_exists filename then
     let last_ext = String.lowercase (Filename2.last_extension filename) in
     if last_ext = ".zip" then
@@ -242,7 +246,7 @@
                | h :: q ->
                    try
                      let file = Zip.find_entry ic h in
-          lprintf_nl "%s found in zip file" h;
+                       lprintf_nl (_b "%s found in zip file") h;
                      ignore(Misc.archive_extract filename "zip");
                      load_merge bl_empty file.Zip.filename true
                    with Not_found ->
@@ -281,7 +285,7 @@
         | _ -> load_merge bl_empty filename false
   else
     begin
-      lprintf_nl "file %s not found" filename;
+      lprintf_nl (_b "file %s not found") filename;
       bl_empty
     end
 




reply via email to

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