Skip to content

Commit

Permalink
fix assert in uTP resend_packet()
Browse files Browse the repository at this point in the history
  • Loading branch information
arvidn committed Dec 30, 2023
1 parent 9c18976 commit 44598ba
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/utp_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1983,7 +1983,9 @@ bool utp_socket_impl::resend_packet(packet* p, bool fast_resend)

// plus one since we have fast-resend as well, which doesn't
// necessarily trigger by a timeout
TORRENT_ASSERT(p->num_transmissions < m_sm.num_resends() + 1);
// the fast-resend path does not check for too many resends, that's only in
// the time-out path
TORRENT_ASSERT_VAL(fast_resend || p->num_transmissions < m_sm.num_resends() + 1, m_sm.num_resends());

TORRENT_ASSERT(p->size - p->header_size >= 0);
if (p->need_resend) m_bytes_in_flight += p->size - p->header_size;
Expand Down

0 comments on commit 44598ba

Please sign in to comment.