mirror of
https://github.com/transmission/transmission
synced 2024-12-25 09:13:06 +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:
parent
6101a69957
commit
cdcc9e249f
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue