Changeset 7475


Ignore:
Timestamp:
Dec 23, 2008, 5:23:07 PM (12 years ago)
Author:
charles
Message:

(trunk libT) fix minor r7474 issue

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/peer-io.c

    r7474 r7475  
    217217
    218218    /* Limit the input buffer to 256K, so it doesn't grow too large */
    219     const size_t canread = 256 * 1024 - EVBUFFER_LENGTH( io->inbuf );
    220     const size_t howmuch = tr_bandwidthClamp( io->bandwidth, TR_DOWN, canread );
     219    size_t howmuch;
    221220    const tr_direction dir = TR_DOWN;
     221    const size_t max = 256 * 1024;
     222    const size_t curlen = EVBUFFER_LENGTH( io->inbuf );
     223
     224    howmuch = curlen >= max ? 0 : max - curlen;
     225    howmuch = tr_bandwidthClamp( io->bandwidth, TR_DOWN, howmuch );
    222226
    223227    assert( tr_isPeerIo( io ) );
Note: See TracChangeset for help on using the changeset viewer.