--- libelwix/src/ring.c 2025/09/26 10:00:46 1.1.2.3 +++ libelwix/src/ring.c 2025/09/26 10:13:57 1.1.2.4 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: ring.c,v 1.1.2.3 2025/09/26 10:00:46 misho Exp $ +* $Id: ring.c,v 1.1.2.4 2025/09/26 10:13:57 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -163,6 +163,8 @@ rbuf_enqueue(ringbuf_t *rbuf, void *data, size_t len) if (!rbuf || !rbuf->rb_buffer) return -1; + if (!rbuf->rb_bufnum) + return 1; h = atomic_load_explicit(&rbuf->rb_head, memory_order_relaxed); t = atomic_load_explicit(&rbuf->rb_tail, memory_order_acquire); @@ -193,6 +195,8 @@ rbuf_dequeue(ringbuf_t *rbuf, struct iovec *out) if (!rbuf || !rbuf->rb_buffer) return -1; + if (!rbuf->rb_bufnum) + return 1; h = atomic_load_explicit(&rbuf->rb_head, memory_order_acquire); t = atomic_load_explicit(&rbuf->rb_tail, memory_order_relaxed);