From b874e125162af9c99a07ea8a916676cd1731791a Mon Sep 17 00:00:00 2001 From: Kim De Mey Date: Thu, 29 Aug 2024 18:15:26 +0200 Subject: [PATCH] Differentiate log for invalid packet seqnr without reorder buffer and not (#723) --- eth/utp/utp_socket.nim | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/eth/utp/utp_socket.nim b/eth/utp/utp_socket.nim index 5f8bab2..8c2550f 100644 --- a/eth/utp/utp_socket.nim +++ b/eth/utp/utp_socket.nim @@ -1212,9 +1212,7 @@ proc processPacketInternal(socket: UtpSocket, p: Packet) = # with a todo. Currently the reference implementation is follow and packets # are not resend in this case. - debug "Packet state variables", - pastExpected = pastExpected, - acks = acks + debug "Packet state variables", pastExpected, acks # If packet is totally off the mark, short-circuit the processing if pastExpected >= reorderBufferMaxSize: @@ -1230,10 +1228,11 @@ proc processPacketInternal(socket: UtpSocket, p: Packet) = pastExpected >= (int(uint16.high) + 1) - reorderBufferMaxSize if (isPossibleDuplicatedOldPacket and p.header.pType != ST_STATE): + debug "Invalid packet sequence number, within reorder buffer", + pastExpected socket.sendAck() - - debug "Got an invalid packet sequence number, too far off", - pastExpected = pastExpected + else: + debug "Invalid packet sequence number, too far off", pastExpected return var (ackedBytes, minRtt) =