(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.
This commit is contained in:
Jordan Lee 2011-05-04 21:38:01 +00:00
parent a0fd938fae
commit f8f02fe7c3
1 changed files with 5 additions and 1 deletions

View File

@ -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 );