[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Mldonkey-commits] mldonkey distrib/ChangeLog src/networks/donkey/...
From: |
mldonkey-commits |
Subject: |
[Mldonkey-commits] mldonkey distrib/ChangeLog src/networks/donkey/... |
Date: |
Tue, 15 Aug 2006 12:37:55 +0000 |
CVSROOT: /sources/mldonkey
Module name: mldonkey
Changes by: spiralvoice <spiralvoice> 06/08/15 12:37:55
Modified files:
distrib : ChangeLog
src/networks/donkey: donkeyGlobals.ml
Log message:
patch #5308
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/mldonkey/distrib/ChangeLog?cvsroot=mldonkey&r1=1.960&r2=1.961
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/networks/donkey/donkeyGlobals.ml?cvsroot=mldonkey&r1=1.84&r2=1.85
Patches:
Index: distrib/ChangeLog
===================================================================
RCS file: /sources/mldonkey/mldonkey/distrib/ChangeLog,v
retrieving revision 1.960
retrieving revision 1.961
diff -u -b -r1.960 -r1.961
--- distrib/ChangeLog 15 Aug 2006 12:37:18 -0000 1.960
+++ distrib/ChangeLog 15 Aug 2006 12:37:55 -0000 1.961
@@ -15,6 +15,7 @@
=========
2006/08/15
+5308: CryptoPP: Fix infinite loop when re-creating private key fails
5307: CryptoPP: Deactivate compiler option -momit-leaf-frame-pointer
5300: Fix iconv compile bug on Eisfair
5299: Support magicdb in $MLDONKEY_DIR/magic/magic if present
Index: src/networks/donkey/donkeyGlobals.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/donkey/donkeyGlobals.ml,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -b -r1.84 -r1.85
--- src/networks/donkey/donkeyGlobals.ml 20 Jul 2006 15:30:21 -0000
1.84
+++ src/networks/donkey/donkeyGlobals.ml 15 Aug 2006 12:37:55 -0000
1.85
@@ -42,6 +42,11 @@
open DonkeyOptions
open CommonOptions
+let log_prefix = "[EDK]"
+
+let lprintf_nl fmt =
+ lprintf_nl2 log_prefix fmt
+
(*************************************************************
Define the instances of the plugin classes, that we be filled
@@ -968,37 +973,36 @@
) list
let client_public_key = ref ""
-
+let key_check_started = ref false
let _ =
option_hook client_private_key (fun _ ->
- if Autoconf.donkey_sui_works () then begin
- client_public_key := DonkeySui.SUI.load_key (!!client_private_key);
- (
- let key_checked = ref false in
- let key_check_again = ref false in
- let rec check_client_private_key () =
- key_checked := true;
+ if Autoconf.donkey_sui_works () then
+ begin
if not (try String.sub !!client_private_key 0 4 = "MIIB" with e ->
false) then
- if !key_check_again then
+ if !key_check_started then
begin
- lprintf_nl "can not create proper client_private_key, exiting...";
+ let s1 =
+ Printf.sprintf "can not create valid client_private_key, bad
value found: %s"
+ !!client_private_key in
+ let s2 = "CryptoPP code seems not to work properly, do not use
insane CFLAGS, exiting..." in
+ Printf.fprintf Pervasives.stderr "%s[EDK] %s\n" (log_time ()) s1;
+ Printf.fprintf Pervasives.stderr "%s[EDK] %s\n" (log_time ()) s2;
+ Pervasives.flush Pervasives.stderr;
+ lprintf_nl "%s" s1;
+ lprintf_nl "%s" s2;
exit 70
end
else
begin
- lprintf_nl "bad client_private_key detected, creating new key";
- set_simple_option donkey_ini "client_private_key"
(DonkeySui.SUI.create_key ());
- key_check_again := true
+ key_check_started := true;
+ lprintf_nl "found bad client_private_key: %s, creating new
key..." !!client_private_key;
+ client_private_key =:= (DonkeySui.SUI.create_key ());
end
- in
- if not !key_checked then check_client_private_key ();
- if !key_check_again then
+ else
begin
- lprintf_nl "re-checking private key";
- check_client_private_key ()
+ client_public_key := DonkeySui.SUI.load_key (!!client_private_key);
end
- );
end
)
- [Mldonkey-commits] mldonkey distrib/ChangeLog src/networks/donkey/...,
mldonkey-commits <=