From: Guus Sliepen Date: Sun, 18 Oct 2015 18:53:55 +0000 (+0200) Subject: Send ACKs also when receiving out-of-order data. X-Git-Url: http://git.meshlink.io/?p=utcp;a=commitdiff_plain;h=f795503080bc1e7a812d58da62513219d2b5db74 Send ACKs also when receiving out-of-order data. This is necessary to trigger the triplicate ACK detection on the sender. --- diff --git a/Makefile b/Makefile index d10352e..c2429e5 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -CFLAGS ?= -O2 -Wall -g +CFLAGS ?= -Og -Wall -g CFLAGS += -std=c99 -DUTCP_DEBUG BIN = selftest test diff --git a/utcp.c b/utcp.c index c21d6ab..25590a0 100644 --- a/utcp.c +++ b/utcp.c @@ -1017,6 +1017,7 @@ ssize_t utcp_recv(struct utcp *utcp, const void *data, size_t len) { //Reset the congestion window so we wait for ACKs. c->snd.nxt = c->snd.una; c->snd.cwnd = utcp->mtu; + start_retransmit_timer(c); } } } @@ -1164,7 +1165,7 @@ ssize_t utcp_recv(struct utcp *utcp, const void *data, size_t len) { // - or we got an ack, so we should maybe send a bit more data // -> sendatleastone = false - ack(c, prevrcvnxt != c->rcv.nxt); + ack(c, len || prevrcvnxt != c->rcv.nxt); return 0; reset: