From: Guus Sliepen Date: Sun, 11 Oct 2015 21:39:23 +0000 (+0200) Subject: Reset the snd.nxt pointer when starting packet retransmission. X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=5d6a4bd71c683042495038e9679cbf7c80d816fd;p=utcp Reset the snd.nxt pointer when starting packet retransmission. When a packet was lost, and the send buffer contains more than two packets, this only retransmitted the first packet from the send buffer, then when it got acked it would continue with the tail of the buffer. Then it would have to wait for another timeout to send the next packet from the start of the send buffer. If the application is continuously sending data, then the send buffer would never become empty and the problem would persist. --- diff --git a/utcp.c b/utcp.c index e347bb7..7624aa5 100644 --- a/utcp.c +++ b/utcp.c @@ -500,6 +500,7 @@ static void retransmit(struct utcp_connection *c) { len--; pkt->hdr.ctl |= FIN; } + c->snd.nxt = c->snd.una + len; buffer_copy(&c->sndbuf, pkt->data, 0, len); print_packet(c->utcp, "rtrx", pkt, sizeof pkt->hdr + len); utcp->send(utcp, pkt, sizeof pkt->hdr + len);