Changeset 8765


Ignore:
Timestamp:
Jul 1, 2009, 12:46:30 AM (13 years ago)
Author:
charles
Message:

(trunk, libT) #2253: I love you, valgrind pt 3

File:
1 edited

Legend:

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

    r8748 r8765  
    268268        evbuffer_drain( buffer, n );
    269269
     270    /* keep the iobuf's excess capacity from growing too large */
     271    if( buffer->totallen > ( EVBUFFER_LENGTH( buffer ) + 1024 ) ) {
     272        struct evbuffer * swap = evbuffer_new( );
     273        evbuffer_add( swap, EVBUFFER_DATA( buffer ), EVBUFFER_LENGTH( buffer ) );
     274        evbuffer_free( buffer );
     275        io->outbuf = swap;
     276    }
     277
    270278    return n;
    271279}
Note: See TracChangeset for help on using the changeset viewer.