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: Mon, 10 Mar 2014 16:51:46 +0000

CVSROOT:        /sources/mldonkey
Module name:    mldonkey
Changes by:     spiralvoice <spiralvoice>       14/03/10 16:51:46

Modified files:
        distrib        : ChangeLog 
        src/daemon/common: commonInteractive.ml 
        src/networks/bittorrent: bTInteractive.ml 
        src/networks/donkey: donkeyInteractive.ml 

Log message:
        patch #8388

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/mldonkey/distrib/ChangeLog?cvsroot=mldonkey&r1=1.1599&r2=1.1600
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/common/commonInteractive.ml?cvsroot=mldonkey&r1=1.114&r2=1.115
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/networks/bittorrent/bTInteractive.ml?cvsroot=mldonkey&r1=1.169&r2=1.170
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/networks/donkey/donkeyInteractive.ml?cvsroot=mldonkey&r1=1.170&r2=1.171

Patches:
Index: distrib/ChangeLog
===================================================================
RCS file: /sources/mldonkey/mldonkey/distrib/ChangeLog,v
retrieving revision 1.1599
retrieving revision 1.1600
diff -u -b -r1.1599 -r1.1600
--- distrib/ChangeLog   10 Mar 2014 16:34:04 -0000      1.1599
+++ distrib/ChangeLog   10 Mar 2014 16:51:45 -0000      1.1600
@@ -15,6 +15,7 @@
 =========
 
 2014/03/10:
+8388: BT: use porttest service from EDK module (ygrek)
 8352: CryptoPP: Fix compilation with gcc-4.7 (Jaakko Perttilä)
 8351: CryptoPP: Fix FreeBSD build with clang on i386 (tijl)
 8350: CryptoPP: Fix compilation on armhf (ygrek)

Index: src/daemon/common/commonInteractive.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonInteractive.ml,v
retrieving revision 1.114
retrieving revision 1.115
diff -u -b -r1.114 -r1.115
--- src/daemon/common/commonInteractive.ml      24 Jun 2012 08:09:07 -0000      
1.114
+++ src/daemon/common/commonInteractive.ml      10 Mar 2014 16:51:45 -0000      
1.115
@@ -1153,3 +1153,32 @@
   option_hook max_concurrent_downloads (fun _ ->
       ignore (force_download_quotas ())
   )
+
+let run_porttest ?udp ~tcp result =
+  result := PorttestInProgress (last_time ());
+  let module H = Http_client in
+  let url = Printf.sprintf 
"http://porttest.emule-project.net:81/ct_noframe.php?lang=&tcpport=%d"; tcp in
+  let url = match udp with
+  | None -> url
+  | Some udp -> url ^ Printf.sprintf "&udpport=%d" udp
+  in
+  let r = { H.basic_request with
+    H.req_url = Url.of_string url;
+    (* no sense to test ports via proxy! *)
+(*       H.req_proxy = !CommonOptions.http_proxy; *)
+    H.req_max_retry = 3;
+    H.req_user_agent = get_user_agent () }
+  in
+  H.wget r begin fun file ->
+    Unix2.tryopen_read file begin fun cin ->
+      try
+        while true do
+          let line = input_line cin in
+          try
+            if Str.string_match (Str.regexp "^<P>Testing IP") line 0 then
+              result := PorttestResult (last_time (), line)
+          with _ -> ()
+        done
+      with End_of_file -> ()
+    end
+  end

Index: src/networks/bittorrent/bTInteractive.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/bittorrent/bTInteractive.ml,v
retrieving revision 1.169
retrieving revision 1.170
diff -u -b -r1.169 -r1.170
--- src/networks/bittorrent/bTInteractive.ml    7 Jul 2013 11:03:34 -0000       
1.169
+++ src/networks/bittorrent/bTInteractive.ml    10 Mar 2014 16:51:45 -0000      
1.170
@@ -56,6 +56,10 @@
 
 let porttest_result = ref PorttestNotStarted
 
+(*
+
+(* not used - services are down *)
+
 let interpret_azureus_porttest s =
   let failure_message fmt = 
     Printf.sprintf ("Port test failure, " ^^ fmt) in
@@ -114,6 +118,7 @@
       (fun _ _ -> ())
   in
   loop tests
+*)
 
 let op_file_all_sources file =
   let list = ref [] in
@@ -1515,6 +1520,9 @@
     ] @ (match !bt_dht with None -> [] | Some dht -> 
[dht.BT_DHT.M.dht_port,"dht_port UDP"]));
   network.op_network_porttest_result <- (fun _ -> !porttest_result);
   network.op_network_porttest_start <- (fun _ -> 
+    let udp = match !bt_dht with None -> None | Some dht -> Some 
dht.BT_DHT.M.dht_port in
+    CommonInteractive.run_porttest ~tcp:!!client_port ?udp porttest_result
+(*
       azureus_porttest_random := (Random.int 100000);
       let tests = [
         Printf.sprintf "http://www.utorrent.com/testport?port=%d"; 
!!client_port, interpret_utorrent_porttest;
@@ -1522,6 +1530,7 @@
           !!client_port !azureus_porttest_random, interpret_azureus_porttest;
       ] in
       perform_porttests tests
+*)
   );
   network.op_network_check_upload_slots <- (fun _ -> check_bt_uploaders ());
   client_ops.op_client_info <- op_client_info;

Index: src/networks/donkey/donkeyInteractive.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/donkey/donkeyInteractive.ml,v
retrieving revision 1.170
retrieving revision 1.171
diff -u -b -r1.170 -r1.171
--- src/networks/donkey/donkeyInteractive.ml    1 Nov 2010 17:09:29 -0000       
1.170
+++ src/networks/donkey/donkeyInteractive.ml    10 Mar 2014 16:51:45 -0000      
1.171
@@ -1655,27 +1655,8 @@
   network.op_network_close_search <- (fun s -> ());
   network.op_network_check_upload_slots <- (fun _ -> ());
   network.op_network_porttest_start <- (fun _ ->
-    porttest_result := PorttestInProgress (last_time ());
-    let module H = Http_client in
-    let r = { H.basic_request with
-      H.req_url = Url.of_string
-        (Printf.sprintf 
"http://porttest.emule-project.net:81/ct_noframe.php?lang=&tcpport=%d&udpport=%d";
-          !!donkey_port (!!donkey_port + 4));
-      H.req_proxy = !CommonOptions.http_proxy;
-      H.req_max_retry = 10;
-      H.req_user_agent = get_user_agent () } in
-    H.wget r (fun file ->
-      Unix2.tryopen_read file (fun cin ->
-       try
-         while true do
-           let line = input_line cin in
-             try
-               if Str.string_match (Str.regexp "^<P>Testing IP") line 0 then
-                 porttest_result := PorttestResult (last_time (), line)
-             with _ -> ()
-         done
-       with End_of_file -> ())
-    ));
+    CommonInteractive.run_porttest porttest_result ~tcp:(!!donkey_port) 
~udp:(!!donkey_port+4)
+  );
   network.op_network_forget_search <- forget_search
 
 (* emule<->mldonkey disconnects during chat, and this doesn't seem to auto 
reconnect



reply via email to

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