diff --git a/include/haproxy/buf.h b/include/haproxy/buf.h index 1136a6a9b..e98161ebe 100644 --- a/include/haproxy/buf.h +++ b/include/haproxy/buf.h @@ -1027,6 +1027,14 @@ static inline unsigned int br_count(const struct buffer *r) return r->data + r->size - r->head; } +/* Returns true if a single buffer is assigned */ +static inline unsigned int br_single(const struct buffer *r) +{ + BUG_ON_HOT(r->area != BUF_RING.area); + + return r->data == r->head; +} + /* Returns the index of the ring's head buffer */ static inline unsigned int br_head_idx(const struct buffer *r) {