mirror of
https://github.com/transmission/transmission
synced 2024-12-27 18:18:10 +00:00
(trunk libT) #4173 "crashing with r12315 in Debian" -- apply patch from comment:8 for testing in 2.30b2
This commit is contained in:
parent
b4cdc74706
commit
bad3cb53a3
1 changed files with 5 additions and 1 deletions
|
@ -1051,13 +1051,17 @@ evbuffer_add_uint64( struct evbuffer * outbuf, uint64_t addme_hll )
|
||||||
void
|
void
|
||||||
tr_peerIoReadBytesToBuf( tr_peerIo * io, struct evbuffer * inbuf, struct evbuffer * outbuf, size_t byteCount )
|
tr_peerIoReadBytesToBuf( tr_peerIo * io, struct evbuffer * inbuf, struct evbuffer * outbuf, size_t byteCount )
|
||||||
{
|
{
|
||||||
|
struct evbuffer * tmp;
|
||||||
const size_t old_length = evbuffer_get_length( outbuf );
|
const size_t old_length = evbuffer_get_length( outbuf );
|
||||||
|
|
||||||
assert( tr_isPeerIo( io ) );
|
assert( tr_isPeerIo( io ) );
|
||||||
assert( evbuffer_get_length( inbuf ) >= byteCount );
|
assert( evbuffer_get_length( inbuf ) >= byteCount );
|
||||||
|
|
||||||
/* append it to outbuf */
|
/* append it to outbuf */
|
||||||
evbuffer_remove_buffer( inbuf, outbuf, byteCount );
|
tmp = evbuffer_new( );
|
||||||
|
evbuffer_remove_buffer( inbuf, tmp, byteCount );
|
||||||
|
evbuffer_add_buffer( outbuf, tmp );
|
||||||
|
evbuffer_free( tmp );
|
||||||
|
|
||||||
/* decrypt if needed */
|
/* decrypt if needed */
|
||||||
if( io->encryption_type == PEER_ENCRYPTION_RC4 ) {
|
if( io->encryption_type == PEER_ENCRYPTION_RC4 ) {
|
||||||
|
|
Loading…
Reference in a new issue