mirror of
https://github.com/transmission/transmission
synced 2024-12-24 08:43:27 +00:00
(trunk libT) back out r8765. xref: http://trac.transmissionbt.com/ticket/2253#comment:13
This commit is contained in:
parent
41066aa306
commit
55cd3a8367
1 changed files with 3 additions and 5 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue