From 30eed7886769d838a5d51b70c764c532ca023b1c Mon Sep 17 00:00:00 2001 From: eunhhu Date: Mon, 19 Oct 2026 07:34:12 +0100 Subject: 140's apps written with the frictions gone: inflate's and linebreak's lists declared together, linebreak's 0x2010 and 0x25CC (their modules the same), DNS's records = [] and 0xc000, HTTP's trailers, j = fields(...), RFC 6298's abs and tick.period (G written once), layout's lists together, its boxes and root as targets together, boxes = []; lines 121 to 120, 148 to 146, 176 to 169, 116 to 110; instructions within 0.2% --- examples/rto.aup | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/rto.aup') diff --git a/examples/rto.aup b/examples/rto.aup index 1d147eb..55412a7 100644 --- a/examples/rto.aup +++ b/examples/rto.aup @@ -23,7 +23,7 @@ input transmit = message { seq: u32 } input ack = message { seq: u32 } input tick = every 10 ms -fn LOWEST = 1000; fn HIGHEST = 60000; fn PERIOD = 10 # milliseconds; the clock's granularity G is the tick's period +fn LOWEST = 1000; fn HIGHEST = 60000 # milliseconds on transmit { outstanding.append(Segment { seq: transmit.seq, sent: now }) @@ -46,10 +46,10 @@ on ack { if !measured { # 2.2 srtt, rttvar, measured = r, r / 2, true } else { # 2.3 - rttvar = 0.75 * rttvar + 0.25 * max(srtt - r, r - srtt) + rttvar = 0.75 * rttvar + 0.25 * abs(srtt - r) srtt = 0.875 * srtt + 0.125 * r } - rto = min(max(srtt + max(PERIOD, 4 * rttvar), LOWEST), HIGHEST) # 2.4, 2.5 + rto = min(max(srtt + max(tick.period, 4 * rttvar), LOWEST), HIGHEST) # 2.4, 2.5 (G: the tick's period) } deadline = if outstanding.count > 0 { now + rto } else { -1 } # 5.3, 5.2 } -- cgit v1.2.3