summaryrefslogtreecommitdiff
path: root/src/lib/timerwheel.c
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2022-03-30 18:34:48 +0200
committerSander Vrijders <sander@ouroboros.rocks>2022-04-01 08:09:22 +0200
commit369400aab2b464b2ef11d30547f5ca7eee2a4b2a (patch)
tree063c4b42dff2f7c7d551feaad6b3c742875e1fd9 /src/lib/timerwheel.c
parent8a1f7dc159cc7a85e92975e1b25fdce1368e8c8e (diff)
downloadouroboros-369400aab2b464b2ef11d30547f5ca7eee2a4b2a.tar.gz
ouroboros-369400aab2b464b2ef11d30547f5ca7eee2a4b2a.zip
lib: Fix timing of delayed ACKs
Delayed ACKs are now sent after twice the internal tick time. Fixes initial ACK record (rcv_cr.seqno) being uninitialized (0) when the first ACK was to be sent. Adds some FRCT metrics for number of received delayed (bare) ACKs and the RTT estimator. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/lib/timerwheel.c')
-rw-r--r--src/lib/timerwheel.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/lib/timerwheel.c b/src/lib/timerwheel.c
index 3225bf35..0f5e2e04 100644
--- a/src/lib/timerwheel.c
+++ b/src/lib/timerwheel.c
@@ -301,7 +301,6 @@ static void timerwheel_move(void)
send_frct_pkt(a->frcti);
free(a);
-
}
}
@@ -394,7 +393,7 @@ static int timerwheel_ack(int fd,
pthread_rwlock_rdlock(&frcti->lock);
- slot = (((ts_to_ns(now) + frcti->mdev) >> ACKQ_RES) + 1)
+ slot = (((ts_to_ns(now) + (TICTIME << 1)) >> ACKQ_RES) + 1)
& (ACKQ_SLOTS - 1);
pthread_rwlock_unlock(&frcti->lock);