mldonkey-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Mldonkey-commits] mldonkey distrib/ChangeLog src/networks/bittorr...


From: mldonkey-commits
Subject: [Mldonkey-commits] mldonkey distrib/ChangeLog src/networks/bittorr...
Date: Sun, 03 Jun 2007 13:13:18 +0000

CVSROOT:        /sources/mldonkey
Module name:    mldonkey
Changes by:     spiralvoice <spiralvoice>       07/06/03 13:13:17

Modified files:
        distrib        : ChangeLog 
        src/networks/bittorrent: bTClients.ml bTGlobals.ml 

Log message:
        patch #5988

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/mldonkey/distrib/ChangeLog?cvsroot=mldonkey&r1=1.1273&r2=1.1274
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/networks/bittorrent/bTClients.ml?cvsroot=mldonkey&r1=1.91&r2=1.92
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/networks/bittorrent/bTGlobals.ml?cvsroot=mldonkey&r1=1.78&r2=1.79

Patches:
Index: distrib/ChangeLog
===================================================================
RCS file: /sources/mldonkey/mldonkey/distrib/ChangeLog,v
retrieving revision 1.1273
retrieving revision 1.1274
diff -u -b -r1.1273 -r1.1274
--- distrib/ChangeLog   2 Jun 2007 16:14:07 -0000       1.1273
+++ distrib/ChangeLog   3 Jun 2007 13:13:17 -0000       1.1274
@@ -14,6 +14,10 @@
 ChangeLog
 =========
 
+2007/06/03
+5988: BT: Completely parse handshake packet of newer BT clients (thx to Berni)
+- this patch should fix the serious performance problem with BT downloads
+
 2007/06/02
 5987: GeoIP: Small cosmetical fix for loading GeoIP.dat (pango)
 5986: Fix GC problem in bz2 code (pango)

Index: src/networks/bittorrent/bTClients.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/bittorrent/bTClients.ml,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -b -r1.91 -r1.92
--- src/networks/bittorrent/bTClients.ml        1 Jun 2007 19:43:41 -0000       
1.91
+++ src/networks/bittorrent/bTClients.ml        3 Jun 2007 13:13:17 -0000       
1.92
@@ -553,6 +553,16 @@
         bt_handler TcpMessages.parsing (client_to_client c) c sock
     );
 
+    let b = TcpBufferedSocket.buf sock in
+(* The receive buffer is normally not empty now, lets parse the rest, most 
likely PeerID *)
+    if b.len <> 0 then
+      ignore (bt_handler TcpMessages.parsing (client_to_client c) c sock);
+
+(* Some newer clients send more opcodes in their handshake packet, lets parse 
them now.
+   Using "while b.len <> 0 do ... done" is not possible here because 
libtorrent clients
+   send unparsable five extra bytes after their PeerID which would result into 
a loop *)
+    if b.len <> 0 then
+      ignore (bt_handler TcpMessages.parsing (client_to_client c) c sock);
     ()
   with
       | Not_found ->
@@ -783,9 +793,10 @@
 *)
 and client_to_client c sock msg =
   if !verbose_msg_clients then begin
+      let (ip,port) = (TcpBufferedSocket.peer_addr sock) in
       let (timeout, next) = get_rtimeout sock in
-      lprintf_nl "CLIENT %d: (%d, %d,%d) Received %s"
-        (client_num c)
+      lprintf_nl "CLIENT %d(%s:%d): (%d, %d,%d) Received %s"
+        (client_num c) (Ip.to_string ip) port
       (last_time ())
       (int_of_float timeout)
       (int_of_float next)

Index: src/networks/bittorrent/bTGlobals.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/bittorrent/bTGlobals.ml,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -b -r1.78 -r1.79
--- src/networks/bittorrent/bTGlobals.ml        31 May 2007 19:24:58 -0000      
1.78
+++ src/networks/bittorrent/bTGlobals.ml        3 Jun 2007 13:13:17 -0000       
1.79
@@ -451,6 +451,7 @@
       | "BX" -> Brand_bittorrentx
       | "CT" (* ctorrent *)
       | "CD" -> Brand_ctorrent
+      | "lt" (* libtorrent *)
       | "LT" -> Brand_libtorrent
       | "MT" -> Brand_moonlighttorrent
       | "SB" -> Brand_swiftbit
@@ -463,7 +464,6 @@
       | "XT" -> Brand_xantorrent
       | "ZT" -> Brand_ziptorrent
       | "bk" -> Brand_bitkitten
-      | "lt" -> Brand_libtorrent
       | "MP" -> Brand_moopolice
       | "UT" -> Brand_utorrent
       | "KT" -> Brand_ktorrent




reply via email to

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