MINOR: ring: add ring_data() to report the amount of data in a ring

This will be used as an accessor for the few functions that need this
outside of ring.c.
This commit is contained in:
Willy Tarreau 2024-02-27 09:12:19 +01:00
parent ee1c92cf10
commit 4c41fcd0da

View File

@ -45,6 +45,12 @@ size_t ring_max_payload(const struct ring *ring);
int ring_dispatch_messages(struct ring *ring, void *ctx, size_t *ofs_ptr, size_t *last_ofs_ptr, uint flags,
ssize_t (*msg_handler)(void *ctx, const struct buffer *buf, size_t ofs, size_t len));
/* returns the number of bytes in the ring */
static inline size_t ring_data(const struct ring *ring)
{
return b_data(&ring->buf);
}
#endif /* _HAPROXY_RING_H */
/*