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: Sun, 08 Oct 2006 14:12:14 +0000

CVSROOT:        /sources/mldonkey
Module name:    mldonkey
Changes by:     spiralvoice <spiralvoice>       06/10/08 14:12:14

Modified files:
        distrib        : ChangeLog 
        src/daemon/common: commonOptions.ml 
        src/daemon/driver: driverControlers.ml driverInteractive.ml 
                           driverMain.ml 
        src/utils/lib  : charset.ml charset.mli 

Log message:
        patch #5445

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/mldonkey/distrib/ChangeLog?cvsroot=mldonkey&r1=1.1044&r2=1.1045
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/common/commonOptions.ml?cvsroot=mldonkey&r1=1.180&r2=1.181
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/driver/driverControlers.ml?cvsroot=mldonkey&r1=1.88&r2=1.89
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/driver/driverInteractive.ml?cvsroot=mldonkey&r1=1.106&r2=1.107
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/driver/driverMain.ml?cvsroot=mldonkey&r1=1.126&r2=1.127
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/utils/lib/charset.ml?cvsroot=mldonkey&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/utils/lib/charset.mli?cvsroot=mldonkey&r1=1.4&r2=1.5

Patches:
Index: distrib/ChangeLog
===================================================================
RCS file: /sources/mldonkey/mldonkey/distrib/ChangeLog,v
retrieving revision 1.1044
retrieving revision 1.1045
diff -u -b -r1.1044 -r1.1045
--- distrib/ChangeLog   8 Oct 2006 14:02:05 -0000       1.1044
+++ distrib/ChangeLog   8 Oct 2006 14:12:13 -0000       1.1045
@@ -15,6 +15,7 @@
 =========
 
 2006/10/08
+5445: Self-test charset conversion, disable conversion if test fails
 5444: BT: Correctly display client connected time,
       also allow correct upload speed calculation (tradie)
 5443: BT: do not allow connections with ourselves (tradie)

Index: src/daemon/common/commonOptions.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonOptions.ml,v
retrieving revision 1.180
retrieving revision 1.181
diff -u -b -r1.180 -r1.181
--- src/daemon/common/commonOptions.ml  2 Oct 2006 12:56:53 -0000       1.180
+++ src/daemon/common/commonOptions.ml  8 Oct 2006 14:12:13 -0000       1.181
@@ -200,6 +200,11 @@
       exit 2
     end;  
 
+  (* Charset conversion self-test *)
+  let filename = "abcdefghijklmnopqrstuvwxyz" in
+  let conv_filename = Charset.to_locale filename in
+  if filename <> conv_filename then Charset.conversion_enabled := false;
+
   Unix2.can_write_to_directory (Filename2.temp_directory ());
 
   if (String2.starts_with (Filename.basename Sys.argv.(0)) "mlnet") then begin

Index: src/daemon/driver/driverControlers.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/driver/driverControlers.ml,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -b -r1.88 -r1.89
--- src/daemon/driver/driverControlers.ml       6 Oct 2006 15:55:37 -0000       
1.88
+++ src/daemon/driver/driverControlers.ml       8 Oct 2006 14:12:13 -0000       
1.89
@@ -320,7 +320,7 @@
             let module M = CommonMessages in
             Buffer.add_string buf M.full_access;
             (match DriverInteractive.real_startup_message () with
-               Some s -> Buffer.add_string buf s;
+               Some s -> Buffer.add_string buf ("\n" ^ s);
              | None -> ());
           end else
         let module M = CommonMessages in

Index: src/daemon/driver/driverInteractive.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/driver/driverInteractive.ml,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -b -r1.106 -r1.107
--- src/daemon/driver/driverInteractive.ml      1 Oct 2006 17:53:59 -0000       
1.106
+++ src/daemon/driver/driverInteractive.ml      8 Oct 2006 14:12:13 -0000       
1.107
@@ -75,6 +75,7 @@
   let s =
   !startup_message ^ (verify_user_admin ()) ^ (check_supported_os ()) 
   ^ (if not !dns_works then "DNS resolution does not work\n" else "")
+  ^ (if not !Charset.conversion_enabled then "Charset conversion does not 
work, disabled\n" else "")
   ^ (match !created_new_base_directory with
        None -> ""
      | Some dir -> (Printf.sprintf "MLDonkey created a new home directory in 
%s\n" dir))
@@ -1894,7 +1895,10 @@
            " gd(jpg)"
        | _, false, false ->
            " gd(neither jpg nor png ?)") ^
-      (if Autoconf.has_iconv then " iconv" else " no-iconv") ^
+      (match Autoconf.has_iconv, !Charset.conversion_enabled with
+       | true, true -> " iconv(active)"
+       | true, false -> " iconv(inactive)"
+       | false, _ -> " no-iconv") ^
       (match Autoconf.magic, !Autoconf.magic_works with
        | true, true -> " magic(active)"
        | true, false -> " magic(inactive)"

Index: src/daemon/driver/driverMain.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/driver/driverMain.ml,v
retrieving revision 1.126
retrieving revision 1.127
diff -u -b -r1.126 -r1.127
--- src/daemon/driver/driverMain.ml     19 Sep 2006 17:07:43 -0000      1.126
+++ src/daemon/driver/driverMain.ml     8 Oct 2006 14:12:13 -0000       1.127
@@ -381,6 +381,9 @@
        end
       end
   );
+  if not !Charset.conversion_enabled then
+    lprintf_nl (_b "Self-test failed, charset conversion disabled.");
+
   load_config ();
   
   add_infinite_option_timer download_sample_rate CommonFile.sample_timer;

Index: src/utils/lib/charset.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/utils/lib/charset.ml,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- src/utils/lib/charset.ml    23 Sep 2006 22:35:12 -0000      1.8
+++ src/utils/lib/charset.ml    8 Oct 2006 14:12:13 -0000       1.9
@@ -172,7 +172,7 @@
 
(**********************************************************************************)
 
 (* taken from camomile *)
-(* $Id: charset.ml,v 1.8 2006/09/23 22:35:12 spiralvoice Exp $ *)
+(* $Id: charset.ml,v 1.9 2006/10/08 14:12:13 spiralvoice Exp $ *)
 (* Copyright 2002, 2003 Yamagata Yoriyuki. distributed with LGPL *)
 
 let utf8_look s i =
@@ -254,7 +254,7 @@
 
(**********************************************************************************)
 
 (* taken from camomile *)
-(* $Id: charset.ml,v 1.8 2006/09/23 22:35:12 spiralvoice Exp $ *)
+(* $Id: charset.ml,v 1.9 2006/10/08 14:12:13 spiralvoice Exp $ *)
 (* Copyright 2002, 2003 Yamagata Yoriyuki. distributed with LGPL *)
 
 let rec length_aux s c i =
@@ -281,7 +281,7 @@
 
 
 (* taken from camomile *)
-(* $Id: charset.ml,v 1.8 2006/09/23 22:35:12 spiralvoice Exp $ *)
+(* $Id: charset.ml,v 1.9 2006/10/08 14:12:13 spiralvoice Exp $ *)
 (* Copyright 2002, 2003 Yamagata Yoriyuki. distributed with LGPL *)
 
 external uint_code : uchar -> int = "%identity"
@@ -1810,6 +1810,8 @@
 (*                                                                             
   *)
 
(**********************************************************************************)
 
+let conversion_enabled = ref true
+
 let convert ~from_charset ~to_charset s =
   if s <> "" then begin
     let t = charset_to_string to_charset in
@@ -1909,7 +1911,7 @@
 
(**********************************************************************************)
 
 let to_locale s =
-  if s = ""
+  if s = "" || not !conversion_enabled
   then s
   else begin
     let s = to_utf8 s in

Index: src/utils/lib/charset.mli
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/utils/lib/charset.mli,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- src/utils/lib/charset.mli   23 Sep 2006 22:35:12 -0000      1.4
+++ src/utils/lib/charset.mli   8 Oct 2006 14:12:14 -0000       1.5
@@ -172,3 +172,4 @@
 
 val default_language : string
 val locstr : string
+val conversion_enabled : bool ref




reply via email to

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