Ignore:
Timestamp:
Apr 7, 2006, 12:09:08 PM (16 years ago)
Author:
titer
Message:

Adds download rate limit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/peer.c

    r133 r210  
    220220    for( ;; )
    221221    {
     222        if( tor && !tr_rcCanTransfer( tor->globalDownload ) )
     223        {
     224            break;
     225        }
     226
    222227        if( peer->size < 1 )
    223228        {
     
    230235            peer->buf   = realloc( peer->buf, peer->size );
    231236        }
     237        /* Never read more than 1K each time, otherwise the rate
     238           control is no use */
    232239        ret = tr_netRecv( peer->socket, &peer->buf[peer->pos],
    233                           peer->size - peer->pos );
     240                          MIN( 1024, peer->size - peer->pos ) );
    234241        if( ret & TR_NET_CLOSE )
    235242        {
Note: See TracChangeset for help on using the changeset viewer.