mldonkey-users
[Top][All Lists]
Advanced

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

[Mldonkey-users] [patch #4417] BT: Improve BT upload speed


From: pango
Subject: [Mldonkey-users] [patch #4417] BT: Improve BT upload speed
Date: Wed, 14 Sep 2005 17:40:08 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Galeon/1.3.20 (Debian package 1.3.20-1)

Follow-up Comment #1, patch #4417 (project mldonkey):

Since BT support needs to write packets much bigger than what the upload
scheduler usually allows in one turn, it uses private accumulators to gather
"upload credits".
The problem probably comes from the fact that private accumulators are not
bounded, and increased unconditionally.
Maybe they should be checked against the available buffer space:
(untested)

--- src/networks/bittorrent/bTClients.ml        8 Sep 2005 12:26:01 -0000    
 1.50
+++ src/networks/bittorrent/bTClients.ml        14 Sep 2005 15:31:24 -0000
@@ -1501,9 +1492,12 @@
       match c.client_upload_requests with
         [] -> ()
       | _ :: tail ->
-          CommonUploads.consume_bandwidth allowed;
-          c.client_allowed_to_write <-
-            c.client_allowed_to_write ++ (Int64.of_int allowed);
+         let new_allowed_to_write =
+           c.client_allowed_to_write ++ (Int64.of_int allowed) in
+         if allowed > 0 && CommonUploads.can_write_len sock (Int64.to_int
new_allowed_to_write) then begin
+            CommonUploads.consume_bandwidth allowed;
+            c.client_allowed_to_write <- new_allowed_to_write;
+         end;
           iter_upload sock c
   )


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/patch/?func=detailitem&item_id=4417>

_______________________________________________
  Message posté via/par Savannah
  http://savannah.nongnu.org/





reply via email to

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