From 5d0cf67a38695ebe65a0506b5c6d6c0d229a3b3e Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Thu, 21 May 2026 22:49:15 +0200 Subject: lib: Add FIN and receive-side linger for msg dealloc qos_msg flows had no end-of-stream signal: a deallocating sender relied on the peer's inactivity timers (~30 s) to notice. Worse, the dealloc-linger path was bugged: a receiver that called flow_dealloc would stop draining its rx_rb while the peer's tail retransmits kept arriving. Peer retransmitted into a black hole until its own dealloc fired, and the whole shutdown stretched takes t_a time. Generalizes frcti_stream_fin_snd to frcti_fin_snd; for msg mode emit a FRCT_FIN-only control packet with the FIN seqno boundary in pci->ackno. Receiver-side frcti_rcv latches rcv_fin_seen and stores the boundary on FRCT_FIN-without-DATA. Fix comment on the FRCT flags. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/lib/dev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/lib/dev.c') diff --git a/src/lib/dev.c b/src/lib/dev.c index 13c7544b..ae0401b7 100644 --- a/src/lib/dev.c +++ b/src/lib/dev.c @@ -1342,10 +1342,10 @@ int fccntl(int fd, new_acc = flow->oflags & FLOWFACCMODE; /* Defer EOS emit until after proc.lock is dropped: */ - /* frcti_stream_fin_snd may block on shm-pool/tx-rb. */ + /* frcti_fin_snd may block on shm-pool/tx-rb. */ if (new_acc == FLOWFRDONLY && old_acc != FLOWFRDONLY - && FRCTI_IS_STREAM(flow->frcti)) + && flow->frcti != NULL) emit_eos = true; rx_acl = ssm_rbuff_get_acl(flow->rx_rb); @@ -1457,7 +1457,7 @@ int fccntl(int fd, pthread_rwlock_unlock(&proc.lock); if (emit_eos) - frcti_stream_fin_snd(flow->frcti); + frcti_fin_snd(flow->frcti); va_end(l); -- cgit v1.2.3