mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 12:28:52 +00:00
I've misread libevent documentation and the check introduced was not entirely correct. Changed `evbuffer_peek` call now to only request the data which would fit into provided iovec.
This commit is contained in:
@@ -1148,7 +1148,7 @@ tr_peerIoReadBytesToBuf (tr_peerIo * io, struct evbuffer * inbuf, struct evbuffe
|
||||
struct evbuffer_iovec iovec;
|
||||
evbuffer_ptr_set (outbuf, &pos, old_length, EVBUFFER_PTR_SET);
|
||||
do {
|
||||
if (evbuffer_peek (outbuf, byteCount, &pos, &iovec, 1) != 1)
|
||||
if (evbuffer_peek (outbuf, -1, &pos, &iovec, 1) != 1)
|
||||
break;
|
||||
tr_cryptoDecrypt (&io->crypto, iovec.iov_len, iovec.iov_base, iovec.iov_base);
|
||||
byteCount -= iovec.iov_len;
|
||||
|
||||
Reference in New Issue
Block a user