[Top][All Lists]
[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, 28 Jan 2007 20:40:00 +0000 |
CVSROOT: /sources/mldonkey
Module name: mldonkey
Changes by: spiralvoice <spiralvoice> 07/01/28 20:40:00
Modified files:
distrib : ChangeLog
src/daemon/common: commonMessages.ml
src/daemon/driver: driverCommands.ml driverControlers.ml
src/networks/donkey: donkeyMain.ml
src/utils/cdk : string2.ml string2.mli
Log message:
patch #5715
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/mldonkey/distrib/ChangeLog?cvsroot=mldonkey&r1=1.1167&r2=1.1168
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/common/commonMessages.ml?cvsroot=mldonkey&r1=1.61&r2=1.62
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/driver/driverCommands.ml?cvsroot=mldonkey&r1=1.215&r2=1.216
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/driver/driverControlers.ml?cvsroot=mldonkey&r1=1.95&r2=1.96
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/networks/donkey/donkeyMain.ml?cvsroot=mldonkey&r1=1.66&r2=1.67
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/utils/cdk/string2.ml?cvsroot=mldonkey&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/utils/cdk/string2.mli?cvsroot=mldonkey&r1=1.11&r2=1.12
Patches:
Index: distrib/ChangeLog
===================================================================
RCS file: /sources/mldonkey/mldonkey/distrib/ChangeLog,v
retrieving revision 1.1167
retrieving revision 1.1168
diff -u -b -r1.1167 -r1.1168
--- distrib/ChangeLog 28 Jan 2007 20:26:46 -0000 1.1167
+++ distrib/ChangeLog 28 Jan 2007 20:39:59 -0000 1.1168
@@ -15,6 +15,11 @@
=========
2007/01/28
+5715: Improve porttest (Schlumpf)
+- use 'porttest' command to start the network porttest the first time,
+ after this to see the results
+- new command 'force_porttest' to force an new porttest
+- improve html porttest output and make it also available in telnet
5716: EDK: Do not send share list to servers with state Connecting
5713: HTML: show messages link in vd clickable (Schlumpf)
Index: src/daemon/common/commonMessages.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonMessages.ml,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -b -r1.61 -r1.62
--- src/daemon/common/commonMessages.ml 11 Jan 2007 12:16:18 -0000 1.61
+++ src/daemon/common/commonMessages.ml 28 Jan 2007 20:39:59 -0000 1.62
@@ -1119,6 +1119,9 @@
<TD class=\"bu bbig\" title=\"Sysinfo\"
onMouseOver=\"mOvr(this,'mOvr1');\" onMouseOut=\"mOut(this);\"
onClick=\"mSub('output','sysinfo')\">Sysinfo</TD>
+<TD class=\"bu bbig\" title=\"Porttest\"
+onMouseOver=\"mOvr(this,'mOvr1');\" onMouseOut=\"mOut(this);\"
+onClick=\"mSub('output','porttest')\">Porttest</TD>
<TD class=\"bu bbig\" title=\"View ChangeLog\"
onMouseOver=\"mOvr(this,'mOvr1');\" onMouseOut=\"mOut(this);\"
onClick=\"top.output.location.href='http://savannah.nongnu.org/cgi-bin/viewcvs/mldonkey/mldonkey/distrib/ChangeLog?rev=HEAD&content-type=text/vnd.viewcvs-markup'\">ChangeLog</TD>
Index: src/daemon/driver/driverCommands.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/driver/driverCommands.ml,v
retrieving revision 1.215
retrieving revision 1.216
diff -u -b -r1.215 -r1.216
--- src/daemon/driver/driverCommands.ml 25 Jan 2007 13:55:37 -0000 1.215
+++ src/daemon/driver/driverCommands.ml 28 Jan 2007 20:39:59 -0000 1.216
@@ -1255,18 +1255,65 @@
_s ""
) , "<num> :\t\t\t\tdisable a particular network";
+ "force_porttest", Arg_none (fun o ->
+ let buf = o.conn_buf in
+ networks_iter (fun n ->
+ match network_porttest_result n with
+ | PorttestNotAvailable -> ()
+ | _ -> network_porttest_start n;
+ );
+ if use_html_mods o then
+ print_command_result o buf "porttest started, use command
+ \\<u\\>\\<a
onclick=\\\"javascript:window.location.href='submit?q=porttest'\\\"\\>porttest\\</a\\>\\</u\\>
to see results"
+ else
+ print_command_result o buf "porttest started, use command 'porttest' to
see results";
+ ""
+ ) , ":\t\t\tforce start network porttest";
+
"porttest", Arg_none (fun o ->
let buf = o.conn_buf in
+ let age time = Date.time_to_string (BasicSocket.last_time () - time)
"verbose" in
+ let list = ref [] in
+ let put_list e = list := e :: !list in
networks_iter (fun n ->
match network_porttest_result n with
- PorttestNotAvailable -> ()
- | _ -> network_porttest_start n);
- if o.conn_output = HTML then
- Printf.bprintf buf "Click this \\<a
href=\\\"porttest\\\"\\>link\\</a\\> to see results"
+ | PorttestNotAvailable ->
+ put_list (n.network_name , "Porttest not available")
+ | PorttestNotStarted ->
+ put_list (n.network_name , "Porttest started");
+ network_porttest_start n
+ | PorttestInProgress time ->
+ put_list (n.network_name , Printf.sprintf "Porttest in progress,
started %s ago" (age time))
+ | PorttestResult (time, s) ->
+ put_list (n.network_name , Printf.sprintf "Porttest finished %s
ago \n%s" (age time) s)
+ );
+ if use_html_mods o then begin
+ Printf.bprintf buf "\\<div class=\\\"shares\\\"\\>\\<table class=main
cellspacing=0 cellpadding=0\\>
+ \\<tr\\>\\<td\\>\\<table cellspacing=0 cellpadding=0
width=100%%\\>
+ \\<tr\\>\\<td class=downloaded
width=100%%\\>\\</td\\>
+ \\<td nowrap class=\\\"fbig\\\"\\>
+ \\<a
onclick=\\\"javascript:window.location.href='submit?q=force_porttest'\\\"\\>Restart
porttest\\</a\\>\\</td\\>
+ \\<td nowrap class=\\\"fbig pr\\\"\\>
+ \\<a
onclick=\\\"javascript:window.location.reload()\\\"\\>Refresh
results\\</a\\>\\</td\\>
+
\\</tr\\>\\</table\\>\\</td\\>\\</tr\\>\\<tr\\>\\<td\\>";
+ html_mods_table_header buf "sharesTable" "shares" [
+ ( "0", "srh", "Network", "Network" ) ;
+ ( "0", "srh", "Result", "Result" ) ]
+ end;
+ html_mods_cntr_init ();
+ List.iter (fun (net, result) ->
+ if use_html_mods o then
+ Printf.bprintf buf "\\<tr class=\\\"dl-%d\\\"\\>\\<td
class=\\\"sr\\\"\\>%s\\</td\\>\\<td class=\\\"sr\\\"\\>%s\\</td\\>\\</tr\\>"
+ (html_mods_cntr ()) net (Str.global_replace (Str.regexp "\n")
"\\<br\\>" result)
+ else
+ Printf.bprintf buf "----- %s: -----\n%s\n\n" net result;
+ ) !list;
+ if use_html_mods o then
+ Printf.bprintf buf "\\</table\\>\\</div\\>\\</td\\>\\</tr\\>\\</table\\>"
else
- Printf.bprintf buf "Test started, you need a HTML browser to display
results";
+ Printf.bprintf buf "\n\nuse command 'porttest' again to refresh the
results \nuse command 'force_porttest' to force a new porttest";
""
- ) , ":\t\t\t\tstart network porttest";
+ ) , ":\t\t\t\tprint network porttest results";
]
Index: src/daemon/driver/driverControlers.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/driver/driverControlers.ml,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -b -r1.95 -r1.96
--- src/daemon/driver/driverControlers.ml 21 Jan 2007 15:18:13 -0000
1.95
+++ src/daemon/driver/driverControlers.ml 28 Jan 2007 20:39:59 -0000
1.96
@@ -1493,25 +1493,6 @@
read_theme_page this_page else
if !!html_mods then !!CommonMessages.download_html_js_mods0
else !!CommonMessages.download_html_js_old)
- | "porttest" ->
- html_open_page buf t r true;
- let age time =
- Date.time_to_string (BasicSocket.last_time () - time) "verbose" in
- networks_iter (fun n ->
- let result =
- match network_porttest_result n with
- PorttestNotAvailable -> None
- | PorttestNotStarted -> Some "porttest not started"
- | PorttestInProgress time ->
- Some (Printf.sprintf "porttest started %s ago" (age time))
- | PorttestResult (time, s) ->
- Some (Printf.sprintf "porttest finished %s ago, %s" (age
time) s)
- in
- (match result with
- None -> ()
- | Some result ->
- Printf.bprintf buf "%s:<br> %s<br>\n" n.network_name
result));
- Printf.bprintf buf "<br><br><a href=\"porttest\">Reload</a>"
| _ -> raise Not_found
with
| Not_found ->
Index: src/networks/donkey/donkeyMain.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/donkey/donkeyMain.ml,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -b -r1.66 -r1.67
--- src/networks/donkey/donkeyMain.ml 21 Jan 2007 15:36:43 -0000 1.66
+++ src/networks/donkey/donkeyMain.ml 28 Jan 2007 20:39:59 -0000 1.67
@@ -407,8 +407,7 @@
network.op_network_porttest_result <-
(fun _ -> match !DonkeyInteractive.porttest_result with
| PorttestResult (time, s) ->
- PorttestResult (time, (Str.global_replace
- (Str.regexp "result_")
"http://porttest.emule-project.net:81/result_" s))
+ PorttestResult (time, (String2.dehtmlize s))
| _ -> !DonkeyInteractive.porttest_result);
CommonInteractive.register_gui_options_panel "eDonkey"
gui_donkey_options_panel;
Index: src/utils/cdk/string2.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/utils/cdk/string2.ml,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- src/utils/cdk/string2.ml 3 Dec 2006 20:49:43 -0000 1.10
+++ src/utils/cdk/string2.ml 28 Jan 2007 20:39:59 -0000 1.11
@@ -328,3 +328,13 @@
Printf.bprintf buf "%02x " (int_of_char c)
) s;
Buffer.contents buf
+
+let ( |> ) x f = f x
+
+let dehtmlize =
+ let br_regexp = Str.regexp_case_fold "<br>" in
+ let tag_regexp = Str.regexp "<[^>]*>" in
+ fun s ->
+ s
+ |> Str.global_replace br_regexp "\n"
+ |> Str.global_replace tag_regexp ""
Index: src/utils/cdk/string2.mli
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/utils/cdk/string2.mli,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- src/utils/cdk/string2.mli 3 Dec 2006 20:49:43 -0000 1.11
+++ src/utils/cdk/string2.mli 28 Jan 2007 20:39:59 -0000 1.12
@@ -104,3 +104,7 @@
val existsi: (int -> char -> bool) -> string -> bool
val for_all: (char -> bool) -> string -> bool
val hex_string_of_string : string -> string
+
+(* [dehtmlize s] replace all <br> with \n and remove all remaining html tags
from string [s] *)
+val dehtmlize: string -> string
+
- [Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co..., (continued)
- [Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co..., mldonkey-commits, 2007/01/08
- [Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co..., mldonkey-commits, 2007/01/08
- [Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co..., mldonkey-commits, 2007/01/11
- [Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co..., mldonkey-commits, 2007/01/15
- [Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co..., mldonkey-commits, 2007/01/15
- [Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co..., mldonkey-commits, 2007/01/17
- [Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co..., mldonkey-commits, 2007/01/21
- [Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co..., mldonkey-commits, 2007/01/25
- [Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co..., mldonkey-commits, 2007/01/25
- [Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co..., mldonkey-commits, 2007/01/25
- [Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co...,
mldonkey-commits <=
- [Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co..., mldonkey-commits, 2007/01/30