From: Willy Tarreau Date: Fri, 30 Nov 2018 13:29:31 +0000 (+0100) Subject: MINOR: htx: add a function to cut the beginning of a DATA block X-Git-Tag: v1.9-dev9~86 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c01ed9ff20a31e5d917cfd5957baba7946ca9c6c;p=thirdparty%2Fhaproxy.git MINOR: htx: add a function to cut the beginning of a DATA block htx_cut_data_blk() is used to cut the beginning of a DATA block after a part of it was tranferred. It simply advances the address, reduces the advertised length and updates the htx's total data count. --- diff --git a/include/proto/htx.h b/include/proto/htx.h index 779aab6d57..2f7aaf7427 100644 --- a/include/proto/htx.h +++ b/include/proto/htx.h @@ -337,6 +337,19 @@ static inline struct ist htx_get_blk_value(const struct htx *htx, const struct h return ret; } +/* Removes bytes from the beginning of DATA block . The block's start + * address and its length are adjusted, and the htx's total data count is + * updated. This is used to mark that part of some data were transfered + * from a DATA block without removing this DATA block. No sanity check is + * performed, the caller is reponsible for doing this exclusively on DATA + * blocks, and never removing more than the block's size. + */ +static inline void htx_cut_data_blk(struct htx *htx, struct htx_blk *blk, uint32_t n) +{ + blk->addr += n; + blk->info -= n; + htx->data -= n; +} /* Returns the space used by metadata in . */ static inline uint32_t htx_meta_space(const struct htx *htx)