From fe73072e0569e792e89fac1a3a88fc4c9f00f691 Mon Sep 17 00:00:00 2001 From: spiralvoice Date: Wed, 28 Jul 2010 16:24:13 +0000 Subject: [PATCH] patch #7254 --- distrib/ChangeLog | 4 ++++ src/utils/net/tcpBufferedSocket.ml | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/distrib/ChangeLog b/distrib/ChangeLog index 3225dcba..92bb010c 100644 --- a/distrib/ChangeLog +++ b/distrib/ChangeLog @@ -14,6 +14,10 @@ http://mldonkey.sourceforge.net/Windows#MinGW_Installation ChangeLog ========= +2010/07/28 +7254: BT/bandwidth controllers: accept incoming connections while downloading +- should improve upload when downlink is saturated (ygrek) + 2010/07/24 7258: russian i18n mlnet_strings (Balamutick/ygrek) diff --git a/src/utils/net/tcpBufferedSocket.ml b/src/utils/net/tcpBufferedSocket.ml index 64100603..891014ef 100644 --- a/src/utils/net/tcpBufferedSocket.ml +++ b/src/utils/net/tcpBufferedSocket.ml @@ -908,7 +908,16 @@ let bandwidth_controler t sock = (match t.read_control with None -> () | Some bc -> - must_read sock (bc.total_bytes = 0 || bc.remaining_bytes > 0)); +(* must_read sock (bc.total_bytes = 0 || bc.remaining_bytes > 0)); *) + (* bandwidth_controler is called before socket is engaged into data transfer. + This can be either upload or download connection, but when download speed + is capped and fully saturated the above condition will be false, + consequently the socket will never get [want_read] property and + will never get considered by the event loop, until finally being + closed on timeout. This bug manifests itself with no _new_ BT upload clients + or inability to connect to servers (DC) when download is running. + This is a temporary fix, bandwidth limiting logic needs some global refactoring *) + must_read sock true); (match t.write_control with None -> () | Some bc -> -- 2.11.4.GIT