From 5d6a4bd71c683042495038e9679cbf7c80d816fd Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Sun, 11 Oct 2015 23:39:23 +0200 Subject: [PATCH] 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. --- utcp.c | 1 + 1 file changed, 1 insertion(+) 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); -- 2.39.2