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
This commit is contained in:
Yat Ho 2024-01-15 14:28:50 +08:00 committed by GitHub
parent 7ec7607bbc
commit 0ce4adf07c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 5 deletions

View File

@ -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 {};
});