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:
parent
7ec7607bbc
commit
0ce4adf07c
|
@ -729,13 +729,10 @@ void tr_peerIo::utp_init([[maybe_unused]] struct_utp_context* ctx)
|
||||||
io->set_enabled(TR_DOWN, true);
|
io->set_enabled(TR_DOWN, true);
|
||||||
io->can_read_wrapper();
|
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
|
// It opens up the congestion window by sending an ACK (soonish) if
|
||||||
// one was not going to be sent.
|
// one was not going to be sent.
|
||||||
if (std::empty(io->inbuf_))
|
utp_read_drained(args->socket);
|
||||||
{
|
|
||||||
utp_read_drained(args->socket);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return {};
|
return {};
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue