From 9719dbe335af4c6add39d739f78a68040b62d8a3 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Wed, 23 Feb 2022 21:14:26 +0100 Subject: lib: Add initial flow liveness monitoring This adds flow liveness monitoring for flows, with a fixed timeout of 120s. I will make it configurable at flow allocation later on (timeout needs to be communicated to the peer). If one peer dies, or doesn't call any IPC calls (flow_write/flow_read/fevent) it will stop sending keepalives and the other peer's read/writes will error on an -EFLOWDOWN after the timeout expires. Packets without a payload (0 length packets) are interpreted as keepalive packets for the flow. They can be sent from any application, but they will not trigger a message read at the receiver side (0 as a return value on flow_read indicates a previous partial read has completed at exactly the buffer size). Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/lib/frct.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/lib/frct.c') diff --git a/src/lib/frct.c b/src/lib/frct.c index ff938aec..e9741aaf 100644 --- a/src/lib/frct.c +++ b/src/lib/frct.c @@ -667,6 +667,7 @@ static int __frcti_snd(struct frcti * frcti, bool rtx; assert(frcti); + assert(shm_du_buff_head(sdb) != shm_du_buff_tail(sdb)); snd_cr = &frcti->snd_cr; rcv_cr = &frcti->rcv_cr; -- cgit v1.2.3