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: Wed, 29 Mar 2006 14:22:09 +0000

CVSROOT:        /sources/mldonkey
Module name:    mldonkey
Branch:         
Changes by:     spiralvoice <address@hidden>    06/03/29 14:22:08

Modified files:
        distrib        : ChangeLog 
        src/daemon/common: commonMessages.ml commonOptions.ml 
                           commonTypes.ml commonWeb.ml 
        src/daemon/driver: driverCommands.ml driverInteractive.ml 
                           driverMain.ml 
        src/networks/donkey: donkeyInteractive.ml donkeyOvernet.ml 
                             donkeyOvernet.mli donkeyProtoKademlia.ml 
                             donkeyProtoOvernet.ml 
        src/networks/soulseek: slskServers.ml 

Log message:
        patch #4996

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/distrib/ChangeLog.diff?tr1=1.774&tr2=1.775&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/daemon/common/commonMessages.ml.diff?tr1=1.49&tr2=1.50&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/daemon/common/commonOptions.ml.diff?tr1=1.134&tr2=1.135&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/daemon/common/commonTypes.ml.diff?tr1=1.49&tr2=1.50&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/daemon/common/commonWeb.ml.diff?tr1=1.28&tr2=1.29&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/daemon/driver/driverCommands.ml.diff?tr1=1.132&tr2=1.133&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/daemon/driver/driverInteractive.ml.diff?tr1=1.69&tr2=1.70&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/daemon/driver/driverMain.ml.diff?tr1=1.102&tr2=1.103&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/networks/donkey/donkeyInteractive.ml.diff?tr1=1.93&tr2=1.94&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/networks/donkey/donkeyOvernet.ml.diff?tr1=1.63&tr2=1.64&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/networks/donkey/donkeyOvernet.mli.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/networks/donkey/donkeyProtoKademlia.ml.diff?tr1=1.18&tr2=1.19&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/networks/donkey/donkeyProtoOvernet.ml.diff?tr1=1.27&tr2=1.28&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/networks/soulseek/slskServers.ml.diff?tr1=1.10&tr2=1.11&r1=text&r2=text

Patches:
Index: mldonkey/distrib/ChangeLog
diff -u mldonkey/distrib/ChangeLog:1.774 mldonkey/distrib/ChangeLog:1.775
--- mldonkey/distrib/ChangeLog:1.774    Sun Mar 19 17:38:08 2006
+++ mldonkey/distrib/ChangeLog  Wed Mar 29 14:22:08 2006
@@ -14,6 +14,12 @@
 ChangeLog
 =========
 
+2006/03/29
+4996: HTML: Add/remove for web_infos (vwi), update old contact.dat URL
+- web_infos, rename command add_url to urladd, new command urlremove
+- prints option help texts for web_infos and calendar command
+- file_kinds are now printed as list with descriptions for easier setup
+
 2006/03/19
 4917: HDD space check
 - New options:
Index: mldonkey/src/daemon/common/commonMessages.ml
diff -u mldonkey/src/daemon/common/commonMessages.ml:1.49 
mldonkey/src/daemon/common/commonMessages.ml:1.50
--- mldonkey/src/daemon/common/commonMessages.ml:1.49   Wed Mar  8 20:05:26 2006
+++ mldonkey/src/daemon/common/commonMessages.ml        Wed Mar 29 14:22:08 2006
@@ -652,9 +652,6 @@
 <TD class=\"bu bbig\" title=\"View all clients\"
 onMouseOver=\"mOvr(this,'mOvr1');\" onMouseOut=\"mOut(this);\"
 onClick=\"mSub('fstatus','version');mSub('output','vc+all')\">View clients</TD>
-<TD class=\"bu bbig\" title=\"View web infos\"
-onMouseOver=\"mOvr(this,'mOvr1');\" onMouseOut=\"mOut(this);\"
-onClick=\"mSub('fstatus','version');mSub('output','vwi')\">View web infos</TD>
 </TR></TBODY></TABLE></DIV>
 
 <DIV ID=\"tab6\" style=\"display: none\">
Index: mldonkey/src/daemon/common/commonOptions.ml
diff -u mldonkey/src/daemon/common/commonOptions.ml:1.134 
mldonkey/src/daemon/common/commonOptions.ml:1.135
--- mldonkey/src/daemon/common/commonOptions.ml:1.134   Sun Mar 19 17:38:08 2006
+++ mldonkey/src/daemon/common/commonOptions.ml Wed Mar 29 14:22:08 2006
@@ -1478,7 +1478,7 @@
 
 let options_version = define_expert_option current_section ["options_version"]
     "(internal option)"
-    int_option 10
+    int_option 11
 
 
 (*************************************************************************)
@@ -1849,19 +1849,23 @@
   option_hook allow_local_network (fun _ ->
       Ip.allow_local_network := !!allow_local_network)
 
+let web_infos_exists url =
+  List.exists (fun (_, _, weburl) ->
+    weburl = url) !!web_infos
+
+let web_infos_remove outdated_web_infos =
+  web_infos =:=
+  List.fold_left (fun acc owi ->
+    let (kind2, _, url2) = owi in
+    List.filter (fun (_,_,url) -> url <> url2) acc
+  ) !!web_infos outdated_web_infos
+
+let web_infos_add kind period url =
+  let web_info = (kind,period,url) in
+  if web_infos_exists url then web_infos_remove [web_info];
+  web_infos =:=  web_info :: !!web_infos
+
 let rec update_options () =
-  let web_infos_remove outdated_web_infos =
-    let web_infos_filter n =
-      List.filter
-        (fun (kind, _, url) ->
-          let (kind2, _, url2) = (List.nth outdated_web_infos n) in
-          kind <> kind2 && url <> url2
-        ) !!web_infos
-    in
-    for n = 0 to (List.length outdated_web_infos) - 1 do
-      web_infos =:= web_infos_filter n;
-    done;
-  in
   let update v =
       lprintf_nl "Updating options to version %i" v;
       options_version =:= v;
@@ -1908,10 +1912,7 @@
           ("ocl", 24,
             
"http://members.lycos.co.uk/appbyhp2/FlockHelpApp/contact-files/contact.ocl";);
         ];
-      web_infos =:= !!web_infos @ [
-          ("contact.dat", 168,
-            "http://www.overnet.org/download/contact.dat";);
-        ];
+      web_infos_add "contact.dat" 168 
"http://www.overnet.org/download/contact.dat";;
       update 4
 
   | 4 ->
@@ -1920,10 +1921,7 @@
           ("server.met", 24,
             
"http://ocbmaurice.dyndns.org/pl/slist.pl/server.met?download/server-best.met";);
         ];
-      web_infos =:= !!web_infos @ [
-          ("server.met", 0,
-            "http://www.gruk.org/server.met.gz";);
-        ];
+      web_infos_add "server.met" 0 "http://www.gruk.org/server.met.gz";;
       update 5
 
   | 5 ->
@@ -1942,22 +1940,30 @@
       update 8
 
   | 8 ->
-      web_infos =:= !!web_infos @ [
-          ("geoip.dat", 0,
-            "http://www.maxmind.com/download/geoip/database/GeoIP.dat.gz";);
-        ];
+      web_infos_add "geoip.dat" 0 
"http://www.maxmind.com/download/geoip/database/GeoIP.dat.gz";;
       update 9
 
   | 9 ->
-      web_infos_remove
-        [
-          ("server.met", 0,
-            "http://www.gruk.org/server.met.gz";);
-        ];
-      web_infos =:= !!web_infos @ [
-          ("server.met", 0,
-            "http://www.jd2k.com/server.met";);
-        ];
+      if web_infos_exists "http://www.gruk.org/server.met.gz"; then
+      begin
+        web_infos_remove
+          [
+           ("server.met", 0, "http://www.gruk.org/server.met.gz";)
+          ];
+       web_infos_add "server.met" 0 "http://www.jd2k.com/server.met";;
+      end;
       update 10
 
+  | 10 ->
+      if web_infos_exists "http://www.overnet.org/download/contact.dat"; then
+      begin
+        web_infos_remove
+          [
+           ("contact.dat", 672,
+             "http://www.overnet.org/download/contact.dat";);
+          ];
+       web_infos_add "contact.dat" 168 
"http://download.overnet.org/contact.dat";;
+      end;
+      update 11
+
   | _ -> ()
Index: mldonkey/src/daemon/common/commonTypes.ml
diff -u mldonkey/src/daemon/common/commonTypes.ml:1.49 
mldonkey/src/daemon/common/commonTypes.ml:1.50
--- mldonkey/src/daemon/common/commonTypes.ml:1.49      Sun Feb  5 13:19:14 2006
+++ mldonkey/src/daemon/common/commonTypes.ml   Wed Mar 29 14:22:08 2006
@@ -878,3 +878,8 @@
     brand_download = 0L;
     brand_upload = 0L;
   }
+
+type kind_type = {
+  f : string -> string -> unit;
+  description : string
+}
Index: mldonkey/src/daemon/common/commonWeb.ml
diff -u mldonkey/src/daemon/common/commonWeb.ml:1.28 
mldonkey/src/daemon/common/commonWeb.ml:1.29
--- mldonkey/src/daemon/common/commonWeb.ml:1.28        Sun Mar  5 10:43:46 2006
+++ mldonkey/src/daemon/common/commonWeb.ml     Wed Mar 29 14:22:08 2006
@@ -41,8 +41,9 @@
 
 let file_kinds = ref []
 
-let add_web_kind kind f =
-  file_kinds := (kind,f) :: !file_kinds
+let add_web_kind kind descr f =
+  let kind_record = { f = f; description = descr } in
+  file_kinds := (kind, kind_record) :: !file_kinds
 
 let mldonkey_wget url f =
   let module H = Http_client in
@@ -125,7 +126,7 @@
 let load_url can_fail kind url =
   let f =
     try
-      (List.assoc kind !file_kinds) url
+      (List.assoc kind !file_kinds).f url
     with e -> failwith (Printf.sprintf "Unknown kind [%s]" kind)
   in
   try
@@ -141,7 +142,7 @@
 
 let load_file kind file =
   try
-    (List.assoc kind !file_kinds) file file
+    (List.assoc kind !file_kinds).f file file
   with e ->
       lprintf_nl "[cWeb] Exception %s while loading kind %s"
         (Printexc2.to_string e) kind
@@ -173,7 +174,8 @@
 
 
 let _ =
-  add_web_kind "rss" (fun url filename ->
+  add_web_kind "rss" "Syndication feeds to get periodically updated data" 
+    (fun url filename ->
       lprintf_nl "[cWeb=rss] parsing feed %s" url;
       let c = Rss.channel_of_file filename in
       (try Sys.remove filename with _ -> ());
Index: mldonkey/src/daemon/driver/driverCommands.ml
diff -u mldonkey/src/daemon/driver/driverCommands.ml:1.132 
mldonkey/src/daemon/driver/driverCommands.ml:1.133
--- mldonkey/src/daemon/driver/driverCommands.ml:1.132  Sun Mar 19 17:38:08 2006
+++ mldonkey/src/daemon/driver/driverCommands.ml        Wed Mar 29 14:22:08 2006
@@ -186,34 +186,6 @@
   if oo.conn_output = HTML then
     Printf.bprintf  buf "\\</table\\>"
 
-let list_web_infos o list =
-  let buf = o.conn_buf in
-  if o.conn_output = HTML then begin
-      html_mods_table_header buf "web_infoTable" "vo" [
-        ( "0", "srh", "Option type", "Type" ) ;
-        ( "0", "srh", "Option delay", "Delay" ) ;
-        ( "0", "srh", "Option value", "Value" ) ] ;
-      let counter = ref 0 in
-      List.iter (fun (kind, period, url) ->
-          incr counter;
-          if (!counter mod 2 == 0) then Printf.bprintf buf "\\<tr 
class=\\\"dl-1\\\"\\>"
-          else Printf.bprintf buf "\\<tr class=\\\"dl-2\\\"\\>";
-          Printf.bprintf buf "
-              \\<td title=\\\"%s\\\" class=\\\"sr\\\"\\>%s\\</td\\>
-             \\<td class=\\\"sr\\\"\\>%d\\</td\\>"  url kind period;
-          Printf.bprintf buf "
-              \\<td class=\\\"sr\\\"\\>%s\\</td\\>
-              \\</tr\\>" url
-      ) list;
-      Printf.bprintf buf "\\</table\\>\\</div\\>"
-    end
-  else begin
-      Printf.bprintf buf "kind / period / url :\n";
-      List.iter (fun (kind, period, url) ->
-          Printf.bprintf buf "%s ; %d ; %s\n"  kind period url
-      )list
-    end
-
 let list_calendar o list =
   let buf = o.conn_buf in
   if o.conn_output = HTML then begin
@@ -347,15 +319,23 @@
           _s "Only 'admin' is allowed to kill MLDonkey"
         ), ":\t\t\t\t\t$bsave and kill the server$n";
 
-    "add_url", Arg_two (fun kind url o ->
-        let v = (kind, 1, url) in
-        if not (List.mem v !!web_infos) then
-          web_infos =:=  v :: !!web_infos;
-        CommonWeb.load_url true kind url;
+    "urladd", Arg_two (fun kind url o ->
+       web_infos_add kind 1 url;
+       CommonWeb.load_url true kind url;
         "url added to web_infos. downloading now"
     ), "<kind> <url> :\t\t\tload this file from the web\n"
        ^"\t\t\t\t\tkind is either server.met (if the downloaded file is a 
server.met)";
 
+    "urlremove", Arg_one (fun url o ->
+       if web_infos_exists url then
+         begin
+           web_infos_remove [("",0,url)];
+            "removed URL from web_infos"
+         end
+       else
+            "URL does not exists in web_infos"
+    ), "<url> :\t\t\tremove URL from web_infos";
+
     "recover_temp", Arg_none (fun o ->
         networks_iter (fun r ->
             try
@@ -455,7 +435,9 @@
     "sysinfo", Arg_none (fun o ->
        let buf = o.conn_buf in
         ignore(buildinfo (o.conn_output = HTML) buf);
+        Printf.bprintf buf "\\<P\\>";
         ignore(runinfo (o.conn_output = HTML) buf o);
+        Printf.bprintf buf "\\<P\\>";
         ignore(diskinfo (o.conn_output = HTML) buf);
         ""
     ), ":\t\t\t\tprint mldonkey core build, runtime and disk information";
@@ -786,12 +768,13 @@
         if use_html_mods o then begin
             Printf.bprintf buf "\\<div class=\\\"vo\\\"\\>
                 \\<table class=main cellspacing=0 
cellpadding=0\\>\\<tr\\>\\<td\\>";
-           if List.length !!calendar = 0 then
+           if !!calendar = [] then
               html_mods_table_one_row buf "serversTable" "servers" [
                 ("", "srh", "no jobs defined"); ]
            else
               list_calendar o !!calendar;
-            Printf.bprintf buf "\\</td\\>\\</tr\\>\\</table\\>\\</div\\>";
+            Printf.bprintf buf 
"\\</td\\>\\</tr\\>\\</table\\>\\</div\\>\\<P\\>";
+           print_option_help o calendar
           end
         else
          if List.length !!calendar = 0 then
@@ -1503,6 +1486,7 @@
 \\<td class=downloaded width=100%%\\>\\</td\\>
 \\<td nowrap class=fbig\\>\\<a 
onclick=\\\"javascript:window.location.href='submit?q=shares'\\\"\\>Shares\\</a\\>\\</td\\>
 \\<td nowrap class=fbig\\>\\<a 
onclick=\\\"javascript:window.location.href='submit?q=users'\\\"\\>Users\\</a\\>\\</td\\>
+\\<td nowrap class=fbig\\>\\<a 
onclick=\\\"javascript:window.location.href='submit?q=vwi'\\\"\\>Web 
infos\\</a\\>\\</td\\>
 \\<td nowrap class=fbig\\>\\<a 
onclick=\\\"javascript:window.location.href='submit?q=vcal'\\\"\\>Calendar\\</a\\>\\</td\\>
 \\<td nowrap class=fbig\\>\\<a 
onclick=\\\"javascript:window.location.href='submit?q=html_mods'\\\"\\>Toggle 
html_mods\\</a\\>\\</td\\>
 \\<td nowrap class=fbig\\>\\<a 
onclick=\\\"javascript:window.location.href='submit?q=voo+1'\\\"\\>Full 
Options\\</a\\>\\</td\\>
@@ -1838,6 +1822,7 @@
 \\<td class=downloaded width=100%%\\>\\</td\\>
 \\<td nowrap class=\\\"fbig fbigb\\\"\\>\\<a 
onclick=\\\"javascript:window.location.href='submit?q=shares'\\\"\\>Shares\\</a\\>\\</td\\>
 \\<td nowrap class=\\\"fbig fbigb\\\"\\>\\<a 
onclick=\\\"javascript:window.location.href='submit?q=users'\\\"\\>Users\\</a\\>\\</td\\>
+\\<td nowrap class=\\\"fbig fbigb\\\"\\>\\<a 
onclick=\\\"javascript:window.location.href='submit?q=vwi'\\\"\\>Web 
infos\\</a\\>\\</td\\>
 \\<td nowrap class=\\\"fbig fbigb\\\"\\>\\<a 
onclick=\\\"javascript:window.location.href='submit?q=vcal'\\\"\\>Calendar\\</a\\>\\</td\\>
 \\<td nowrap class=\\\"fbig fbigb\\\"\\>\\<a 
onclick=\\\"javascript:parent.fstatus.location.href='submit?q=save'\\\"\\>Save\\</a\\>\\</td\\>
 \\<td nowrap class=\\\"fbig fbigb\\\"\\>\\<a 
onclick=\\\"javascript:window.location.href='submit?q=html_mods'\\\"\\>toggle 
html_mods\\</a\\>\\</td\\>
@@ -1875,14 +1860,84 @@
     "vwi", Arg_none (fun o ->
         let buf = o.conn_buf in
         if use_html_mods o then begin
-            Printf.bprintf buf "\\<div class=\\\"vo\\\"\\>
-                \\<table class=main cellspacing=0 
cellpadding=0\\>\\<tr\\>\\<td\\>";
-            list_web_infos o !!web_infos;
-            Printf.bprintf buf "\\</td\\>\\</tr\\>\\</table\\>\\</div\\>";
+            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 pr\\\"\\>\\<a onclick=\\\"javascript: {
+                   var getdir = prompt('Input: <kind> <URL>','server.met URL')
+                   parent.fstatus.location.href='submit?q=urladd+' + 
encodeURIComponent(getdir);
+                   setTimeout('window.location.reload()',1000);
+                    }\\\"\\>Add URL\\</a\\>
+\\</td\\>
+\\</tr\\>\\</table\\>
+\\</td\\>\\</tr\\>
+\\<tr\\>\\<td\\>";
+
+            if !!web_infos = [] then
+              html_mods_table_one_row buf "serversTable" "servers" [
+                ("", "srh", "no jobs defined"); ]
+           else begin
+
+             html_mods_table_header buf "web_infoTable" "vo" [
+               ( "0", "srh ac", "Click to remove URL", "Remove" ) ;
+               ( "0", "srh", "Option type", "Type" ) ;
+               ( "0", "srh", "Option delay", "Delay" ) ;
+               ( "0", "srh", "Option value", "Value" ) ] ;
+
+              let counter = ref 0 in
+
+              List.iter (fun (kind, period, url) ->
+                incr counter;
+                Printf.bprintf buf "\\<tr class=\\\"%s\\\"\\>"
+                (if !counter mod 2 == 0 then "dl-1" else "dl-2");
+               Printf.bprintf buf "
+        \\<td title=\\\"Click to remove URL\\\"
+        onMouseOver=\\\"mOvr(this);\\\"
+        onMouseOut=\\\"mOut(this);\\\"
+        onClick=\\\'javascript:{
+       
parent.fstatus.location.href=\\\"submit?q=urlremove+\\\\\\\"%s\\\\\\\"\\\"
+        setTimeout(\\\"window.location.reload()\\\",1000);}'
+        class=\\\"srb\\\"\\>Remove\\</td\\>" (Url.encode url);
+          Printf.bprintf buf "
+              \\<td title=\\\"%s\\\" class=\\\"sr\\\"\\>%s\\</td\\>
+             \\<td class=\\\"sr\\\"\\>%d\\</td\\>"  url kind period;
+          Printf.bprintf buf "
+              \\<td class=\\\"sr\\\"\\>%s\\</td\\>
+              \\</tr\\>" url
+              ) !!web_infos;
+           end;
+            Printf.bprintf buf 
"\\</table\\>\\</td\\>\\<tr\\>\\</table\\>\\</div\\>\\<P\\>";
+
+           html_mods_table_header buf "web_infoTable" "vo" [
+             ( "0", "srh", "Web kind", "Kind" );
+             ( "0", "srh", "Description", "Type" ) ];
+
+            let counter = ref 0 in
+            List.iter (fun (kind, data) ->
+                incr counter;
+                Printf.bprintf buf "\\<tr class=\\\"%s\\\"\\>"
+                (if !counter mod 2 == 0 then "dl-1" else "dl-2");
+               Printf.bprintf buf "
+              \\<td class=\\\"sr\\\"\\>%s\\</td\\>
+             \\<td class=\\\"sr\\\"\\>%s\\</td\\>" kind data.description
+            ) !CommonWeb.file_kinds;
+
+            Printf.bprintf buf 
"\\</table\\>\\</td\\>\\<tr\\>\\</table\\>\\</div\\>\\<P\\>";
+           print_option_help o web_infos
+
           end
-        else begin
-            list_web_infos o !!web_infos
-          end;
+        else
+           begin
+             Printf.bprintf buf "kind / period / url :\n";
+             List.iter (fun (kind, period, url) ->
+                 Printf.bprintf buf "%s ; %d ; %s\n"  kind period url
+             ) !!web_infos;
+             Printf.bprintf buf "\nAllowed values for kind:\n";
+             List.iter (fun (kind, data) ->
+                 Printf.bprintf buf "%s - %s\n" kind data.description
+             ) !CommonWeb.file_kinds
+           end;
         ""
     ), ":\t\t\t\t\tprint web_infos options";
 
@@ -2098,7 +2153,8 @@
             )
             !!shared_directories;
   
-            Printf.bprintf buf 
"\\</table\\>\\</td\\>\\<tr\\>\\</table\\>\\</div\\>";
+            Printf.bprintf buf 
"\\</table\\>\\</td\\>\\<tr\\>\\</table\\>\\</div\\>\\<P\\>";
+           print_option_help o shared_directories
           end
         else
           begin
Index: mldonkey/src/daemon/driver/driverInteractive.ml
diff -u mldonkey/src/daemon/driver/driverInteractive.ml:1.69 
mldonkey/src/daemon/driver/driverInteractive.ml:1.70
--- mldonkey/src/daemon/driver/driverInteractive.ml:1.69        Sun Mar 19 
17:38:08 2006
+++ mldonkey/src/daemon/driver/driverInteractive.ml     Wed Mar 29 14:22:08 2006
@@ -1912,3 +1912,19 @@
        ) !list;
   if html then
     Printf.bprintf buf "\\</table\\>\\</td\\>\\<tr\\>\\</table\\>\\</div\\>"
+
+let print_option_help o option =
+  let buf = o.conn_buf in
+  let help_text = get_help option in
+  if use_html_mods o then
+    begin
+      Printf.bprintf buf "\\<div class=\\\"cs\\\"\\>";
+      html_mods_table_header buf "versionTable" "results" [];
+      Printf.bprintf buf "\\<tr\\>";
+      html_mods_td buf [ ("", "srh", "Helptext"); ];
+      Printf.bprintf buf "\\</tr\\>\\<tr class=\\\"dl-1\\\"\\>";
+      html_mods_td buf [ ("", "sr", Str.global_replace (Str.regexp "\n") 
"\\<br\\>" help_text); ];
+      Printf.bprintf buf "\\</tr\\>\\</table\\>\\</div\\>\\</div\\>";
+    end
+  else
+    Printf.bprintf buf "\n\t--Helptext--\n%s\n" help_text
Index: mldonkey/src/daemon/driver/driverMain.ml
diff -u mldonkey/src/daemon/driver/driverMain.ml:1.102 
mldonkey/src/daemon/driver/driverMain.ml:1.103
--- mldonkey/src/daemon/driver/driverMain.ml:1.102      Sun Mar 19 17:38:08 2006
+++ mldonkey/src/daemon/driver/driverMain.ml    Wed Mar 29 14:22:08 2006
@@ -141,11 +141,13 @@
 
 
 let _ =
-  CommonWeb.add_web_kind "motd.html" (fun _ filename ->
+  CommonWeb.add_web_kind "motd.html" "Information of the day in HTML format" 
+    (fun _ filename ->
       lprintf_nl () (_b "motd.html changed");
     motd_html =:= File.to_string filename
   );
-  CommonWeb.add_web_kind "motd.conf" (fun _ filename ->
+  CommonWeb.add_web_kind "motd.conf" "Setup changes of the day" 
+    (fun _ filename ->
     let ic = open_in filename in
     try
       while true do
@@ -170,12 +172,15 @@
        (Printexc2.to_string e);
        close_in ic
   );
-  CommonWeb.add_web_kind "guarding.p2p" (fun _ filename ->
+  CommonWeb.add_web_kind "guarding.p2p" 
+    "IP blocking lists (ipfilter and guardian v2 formats)" 
+    (fun _ filename ->
       Ip_set.bl := Ip_set.load filename;
 (*      Ip_set.bl := Ip_set.load_merge !Ip_set.bl filename *)
       CommonServer.check_blocked_servers ()
   );
-  CommonWeb.add_web_kind "geoip.dat" (fun _ filename ->
+  CommonWeb.add_web_kind "geoip.dat" "IP to country mapping database" 
+    (fun _ filename ->
       Geoip.init (Geoip.unpack filename);
       CommonServer.server_must_update_all ())
 
Index: mldonkey/src/networks/donkey/donkeyInteractive.ml
diff -u mldonkey/src/networks/donkey/donkeyInteractive.ml:1.93 
mldonkey/src/networks/donkey/donkeyInteractive.ml:1.94
--- mldonkey/src/networks/donkey/donkeyInteractive.ml:1.93      Sat Feb 11 
14:43:20 2006
+++ mldonkey/src/networks/donkey/donkeyInteractive.ml   Wed Mar 29 14:22:08 2006
@@ -1737,7 +1737,8 @@
   )
 
 let _ =
-  CommonWeb.add_web_kind "server.met" (fun url filename ->
+  CommonWeb.add_web_kind "server.met" "List of donkey servers" 
+    (fun url filename ->
     if !!enable_donkey && !!update_server_list_server_met then
       begin
         lprintf_n () "server.met loaded from %s" url;
@@ -1759,7 +1760,8 @@
       else
         lprintf_nl () "ED2K_update_server_list_met is disabled, ignoring..."
   );
-  CommonWeb.add_web_kind "comments.met" (fun _ filename ->
+  CommonWeb.add_web_kind "comments.met" "List of edonkey files comments" 
+    (fun _ filename ->
 (* TODO      DonkeyIndexer.load_comments filename; *)
       lprintf_nl () "COMMENTS ADDED";
   );
Index: mldonkey/src/networks/donkey/donkeyOvernet.ml
diff -u mldonkey/src/networks/donkey/donkeyOvernet.ml:1.63 
mldonkey/src/networks/donkey/donkeyOvernet.ml:1.64
--- mldonkey/src/networks/donkey/donkeyOvernet.ml:1.63  Sun Feb  5 13:17:40 2006
+++ mldonkey/src/networks/donkey/donkeyOvernet.ml       Wed Mar 29 14:22:08 2006
@@ -313,6 +313,7 @@
         UdpSocket.t -> UdpSocket.event -> unit
 
       val web_info : string
+      val web_info_descr : string
     end) = struct
 
     open Proto
@@ -1883,7 +1884,7 @@
    end   
 
 let _ =
-  CommonWeb.add_web_kind web_info (fun _ filename ->
+  CommonWeb.add_web_kind web_info web_info_descr (fun _ filename ->
       let s = File.to_string filename in
       let s = String2.replace s '"' "" in
       let lines = String2.split_simplify s '\n' in
@@ -1905,7 +1906,8 @@
 
   (* Add this kind of web_info only for overnet *)
   if Proto.redirector_section = "DKKO" then
-      CommonWeb.add_web_kind "contact.dat" (fun url filename ->
+    CommonWeb.add_web_kind "contact.dat" "List of Overnet boot peers" 
+      (fun url filename ->
         if !!enable_overnet && !!overnet_update_nodes then
           let n = load_contact_dat filename in
             lprintf_nl () "contact.dat loaded from %s, added %d peers" url n;
Index: mldonkey/src/networks/donkey/donkeyOvernet.mli
diff -u mldonkey/src/networks/donkey/donkeyOvernet.mli:1.7 
mldonkey/src/networks/donkey/donkeyOvernet.mli:1.8
--- mldonkey/src/networks/donkey/donkeyOvernet.mli:1.7  Sat Dec 17 20:14:38 2005
+++ mldonkey/src/networks/donkey/donkeyOvernet.mli      Wed Mar 29 14:22:08 2006
@@ -120,6 +120,7 @@
         UdpSocket.t -> UdpSocket.event -> unit
         
       val web_info : string
+      val web_info_descr : string
     end) : sig
     
     val overnet_search : CommonTypes.search -> unit
Index: mldonkey/src/networks/donkey/donkeyProtoKademlia.ml
diff -u mldonkey/src/networks/donkey/donkeyProtoKademlia.ml:1.18 
mldonkey/src/networks/donkey/donkeyProtoKademlia.ml:1.19
--- mldonkey/src/networks/donkey/donkeyProtoKademlia.ml:1.18    Sat Dec 17 
20:14:38 2005
+++ mldonkey/src/networks/donkey/donkeyProtoKademlia.ml Wed Mar 29 14:22:08 2006
@@ -503,6 +503,7 @@
     let command_prefix = "kad_"
 
     let web_info = "kad"
+    let web_info_descr = "Kad network boot peers"
   end
 
 module Kademlia = Make(P)
Index: mldonkey/src/networks/donkey/donkeyProtoOvernet.ml
diff -u mldonkey/src/networks/donkey/donkeyProtoOvernet.ml:1.27 
mldonkey/src/networks/donkey/donkeyProtoOvernet.ml:1.28
--- mldonkey/src/networks/donkey/donkeyProtoOvernet.ml:1.27     Sun Dec 18 
14:50:38 2005
+++ mldonkey/src/networks/donkey/donkeyProtoOvernet.ml  Wed Mar 29 14:22:08 2006
@@ -464,6 +464,7 @@
     let command_prefix = "ov_"
     let source_brand = true
     let web_info = "ocl"
+    let web_info_descr = "Overnet network boot peers"
   end
 
 module Overnet_initial = Make(Proto)
Index: mldonkey/src/networks/soulseek/slskServers.ml
diff -u mldonkey/src/networks/soulseek/slskServers.ml:1.10 
mldonkey/src/networks/soulseek/slskServers.ml:1.11
--- mldonkey/src/networks/soulseek/slskServers.ml:1.10  Thu Jul 29 10:25:34 2004
+++ mldonkey/src/networks/soulseek/slskServers.ml       Wed Mar 29 14:22:08 2006
@@ -207,6 +207,7 @@
 
 let servers_line = "--servers"
 let slsk_kind =  "slsk_server_list"
+let slsk_kind_descr = "List of Soulseek servers (?)"
 
 let load_server_list_last = ref 0
 let load_server_list _ filename  = 
@@ -261,7 +262,7 @@
   update_server_list ()
 
 let _ =
-  CommonWeb.add_web_kind slsk_kind load_server_list;
+  CommonWeb.add_web_kind slsk_kind slsk_kind_descr load_server_list;
   option_hook login can_retry;
   option_hook global_login can_retry;
   option_hook password can_retry




reply via email to

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