diff --git a/include/proto/channel.h b/include/proto/channel.h index 017c5d179..a33262e21 100644 --- a/include/proto/channel.h +++ b/include/proto/channel.h @@ -922,6 +922,23 @@ static inline void co_skip(struct channel *chn, int len) chn->flags |= CF_WRITE_PARTIAL | CF_WROTE_DATA; } +/* HTX version of co_skip(). This function skips at most bytes from the + * output of the channel . Depending on how data are stored in less + * than bytes can be skipped. Channel flags WRITE_PARTIAL and WROTE_DATA + * are set. + */ +static inline void co_htx_skip(struct channel *chn, struct htx *htx, int len) +{ + struct htx_ret htxret; + + htxret = htx_drain(htx, len); + if (htxret.ret) { + chn->output -= htxret.ret; + + /* notify that some data was written to the SI from the buffer */ + chn->flags |= CF_WRITE_PARTIAL | CF_WROTE_DATA; + } +} /* Tries to copy chunk into the channel's buffer after length controls. * The chn->o and to_forward pointers are updated. If the channel's input is