From 1c7d81a46858bb6081198233431ba822d46f67a6 Mon Sep 17 00:00:00 2001 From: arvidn Date: Fri, 29 Dec 2023 16:56:23 +0100 Subject: [PATCH] fix assert in uTP resend_packet() --- src/utp_stream.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utp_stream.cpp b/src/utp_stream.cpp index e2b40c896b3..2adfe4c4451 100644 --- a/src/utp_stream.cpp +++ b/src/utp_stream.cpp @@ -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;