From 71486f8c86ea011e9fe277e462cf475b64f12f41 Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Fri, 18 Feb 2011 00:40:38 +0000 Subject: [PATCH] call UTP_RBDrained when our read buffer is empty --- libtransmission/peer-io.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libtransmission/peer-io.c b/libtransmission/peer-io.c index 4f2e948c6..7d10e026e 100644 --- a/libtransmission/peer-io.c +++ b/libtransmission/peer-io.c @@ -1134,8 +1134,11 @@ tr_peerIoTryRead( tr_peerIo * io, size_t howmuch ) { if( io->utp_socket != NULL ) /* utp peer connection */ { - /* currently a noop. tr-utp's call to UTP_CheckTimeouts() - * keeps the pump primed, so no need to call UTP_RBDrained() */ + /* UTP_RBDrained notifies libutp that your read buffer is emtpy. + * It opens up the congestion window by sending an ACK (soonish) + * if one was not going to be sent. */ + if( evbuffer_get_length( io->inbuf ) == 0 ) + UTP_RBDrained( io->utp_socket ); } else /* tcp peer connection */ {