From 406f13186d76ed4f1dc85e05ffdfe28b340d4d3a Mon Sep 17 00:00:00 2001 From: Ivan Mahonin Date: Oct 25 2021 18:49:02 +0000 Subject: fix bugs2 --- diff --git a/udpsendqueue.cpp b/udpsendqueue.cpp index b272c01..4e645fe 100644 --- a/udpsendqueue.cpp +++ b/udpsendqueue.cpp @@ -51,6 +51,7 @@ void UdpSendQueue::moveToEnd(Entry *e) { e->next = nullptr; e->prev = busyLast; (e->prev ? e->prev->next : busyFirst) = e; + busyLast = e; } @@ -67,8 +68,10 @@ void UdpSendQueue::confirm(unsigned int index, const unsigned char *bits, unsign DebugMsg("%u, %u, %s", connection.id.id, index, bitsToString(bits, bitsCount ? (bitsCount-1)/8 + 1 : 0)); Entry *e = busyFirst; while(e) { - if (e->index >= index) { + if (cycleLequal(index, e->index)) { unsigned int bit = e->index - index; + if (bit >= bitsCount) + { e = e->next; continue; } unsigned int byte = bit / 8; bit %= 8; if ( !(bits[byte] & (1 << bit)) ) @@ -89,7 +92,7 @@ bool UdpSendQueue::sendUdpSingle() { return false; Entry *e = busyFirst; - if (e && !timeLequal(e->resendTime, time)) + if (e && timeLess(time, e->resendTime)) e = nullptr; if (!e && !freeFirst)