From: Jordan Lee Date: Wed, 4 May 2011 21:38:01 +0000 (+0000) Subject: (trunk libT) #2338 "Add uTP support" -- increase the block bandwidth to 3000 bytes... X-Git-Tag: 2.30~23 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f8f02fe7c3282b8e99fc687cc952920e618cb6bb;p=transmission (trunk libT) #2338 "Add uTP support" -- increase the block bandwidth to 3000 bytes in phase 1 as suggested by jch in comment:120. The rationale is that by using 3000 bytes we'll send one full-size frame straight away, and leave enough buffered data for the next frame to go out in a timely manner. --- diff --git a/libtransmission/bandwidth.c b/libtransmission/bandwidth.c index 96c00053e..c728fcf73 100644 --- a/libtransmission/bandwidth.c +++ b/libtransmission/bandwidth.c @@ -225,7 +225,11 @@ phaseOne( tr_ptrArray * peerArray, tr_direction dir ) i = n ? tr_cryptoWeakRandInt( n ) : 0; /* pick a random starting point */ while( n > 0 ) { - const size_t increment = 1024; + /* value of 3000 bytes chosen so that when using uTP we'll send a full-size + * frame right away and leave enough buffered data for the next frame to go + * out in a timely manner. */ + const size_t increment = 3000; + const int bytesUsed = tr_peerIoFlush( peers[i], dir, increment ); dbgmsg( "peer #%d of %d used %d bytes in this pass", i, n, bytesUsed );