From: William Lallemand Date: Wed, 11 Aug 2021 11:40:14 +0000 (+0200) Subject: MINOR: channel: remove an htx block from a channel X-Git-Tag: v2.5-dev4~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c29fa7454137f655903b8b5d8c137c66f321863;p=thirdparty%2Fhaproxy.git MINOR: channel: remove an htx block from a channel co_htx_remove_blk() implements a way to remove an htx block from a channel buffer and update the channel output. --- diff --git a/include/haproxy/channel.h b/include/haproxy/channel.h index efa85ba07d..f263b88c12 100644 --- a/include/haproxy/channel.h +++ b/include/haproxy/channel.h @@ -999,6 +999,18 @@ static inline int co_getchr(struct channel *chn) return *co_head(chn); } +/* Remove a block in a structure which is used by a channel + * Update the channel output according to the size of the block removed + * Return the size of the removed block*/ +static inline int32_t co_htx_remove_blk(struct channel *chn, struct htx *htx, struct htx_blk *blk) +{ + int32_t size = htx_get_blksz(blk); + + htx_remove_blk(htx, blk); + co_set_data(chn, co_data(chn) - size); + + return size; +} #endif /* _HAPROXY_CHANNEL_H */