summaryrefslogtreecommitdiff
path: root/src/lib/frct.c
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2022-02-23 21:14:26 +0100
committerSander Vrijders <sander@ouroboros.rocks>2022-02-24 17:27:46 +0100
commit9719dbe335af4c6add39d739f78a68040b62d8a3 (patch)
tree071a8141e0dcb1544b441ccc985a691545588b45 /src/lib/frct.c
parent65820fa84f2b16ee1c9291135a49a75437baeb4e (diff)
downloadouroboros-9719dbe335af4c6add39d739f78a68040b62d8a3.tar.gz
ouroboros-9719dbe335af4c6add39d739f78a68040b62d8a3.zip
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 <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/lib/frct.c')
-rw-r--r--src/lib/frct.c1
1 files changed, 1 insertions, 0 deletions
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;