]> git.meshlink.io Git - utcp/blobdiff - utcp.c
Send ACKs also when receiving out-of-order data.
[utcp] / utcp.c
diff --git a/utcp.c b/utcp.c
index c21d6ab664b0146030c44d60e6feb730e924f0d8..25590a091560df177d7bbd4d75afed8ad01ba4e1 100644 (file)
--- 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: