diff --git a/include/common/htx.h b/include/common/htx.h index 3385f1485..56a6c9b96 100644 --- a/include/common/htx.h +++ b/include/common/htx.h @@ -633,6 +633,15 @@ static inline uint32_t htx_free_space(const struct htx *htx) return (htx->size - htx_used_space(htx)); } +/* Returns the maximum space usable for data in . This is in fact the + * maximum sice for a uniq block to fill the HTX message. */ +static inline uint32_t htx_max_data_space(const struct htx *htx) +{ + if (!htx->size) + return 0; + return (htx->size - sizeof(htx->blocks[0])); +} + /* Returns the maximum size available to store some data in if a new block * is reserved. */