1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-24 08:43:27 +00:00
This commit is contained in:
Charles Kerr 2009-07-18 01:09:56 +00:00
parent 41066aa306
commit 55cd3a8367

View file

@ -268,11 +268,9 @@ tr_evbuffer_write( tr_peerIo * io, int fd, size_t howmuch )
evbuffer_drain( buffer, n ); evbuffer_drain( buffer, n );
/* keep the iobuf's excess capacity from growing too large */ /* keep the iobuf's excess capacity from growing too large */
if( buffer->totallen > ( EVBUFFER_LENGTH( buffer ) + 4096 ) ) { if( EVBUFFER_LENGTH( io->outbuf ) == 0 ) {
struct evbuffer * swap = evbuffer_new( ); evbuffer_free( io->outbuf );
evbuffer_add( swap, EVBUFFER_DATA( buffer ), EVBUFFER_LENGTH( buffer ) ); io->outbuf = evbuffer_new( );
evbuffer_free( buffer );
io->outbuf = swap;
} }
return n; return n;