]> git.meshlink.io Git - meshlink/commitdiff
Don't start RTT measurements for unreliable channels.
authorGuus Sliepen <guus@meshlink.io>
Mon, 18 May 2020 18:34:54 +0000 (20:34 +0200)
committerGuus Sliepen <guus@meshlink.io>
Sat, 30 May 2020 19:59:30 +0000 (21:59 +0200)
We are not getting ACKs back, and the RTT value is not used for unreliable
channels anyway.

src/utcp.c

index f81150bf7ee7ec06a1aa9d0e88c2ab5751eb743a..dc5a2fcfa59237d2d291ba8e0fc12d1563c98916 100644 (file)
@@ -719,7 +719,7 @@ static void ack(struct utcp_connection *c, bool sendatleastone) {
                        pkt->hdr.ctl |= FIN;
                }
 
-               if(!c->rtt_start.tv_sec) {
+               if(!c->rtt_start.tv_sec && is_reliable(c)) {
                        // Start RTT measurement
                        clock_gettime(UTCP_CLOCK, &c->rtt_start);
                        c->rtt_seq = pkt->hdr.seq + seglen;