From 0ce4adf07ce4b6cfabf81e2d027f96197bb9a305 Mon Sep 17 00:00:00 2001 From: Yat Ho Date: Mon, 15 Jan 2024 14:28:50 +0800 Subject: [PATCH] fix: always schedule uTP ack after receiving a packet (#6508) * fix: always schedule uTP ack after receiving a packet * chore: add comment to explain change --- libtransmission/peer-io.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/libtransmission/peer-io.cc b/libtransmission/peer-io.cc index 1577119fd..74df46f1c 100644 --- a/libtransmission/peer-io.cc +++ b/libtransmission/peer-io.cc @@ -729,13 +729,10 @@ void tr_peerIo::utp_init([[maybe_unused]] struct_utp_context* ctx) io->set_enabled(TR_DOWN, true); io->can_read_wrapper(); - // utp_read_drained() notifies libutp that this read buffer is empty. + // utp_read_drained() notifies libutp that we read a packet from them. // It opens up the congestion window by sending an ACK (soonish) if // one was not going to be sent. - if (std::empty(io->inbuf_)) - { - utp_read_drained(args->socket); - } + utp_read_drained(args->socket); } return {}; });