From 8b604d1656c2b390e09eacb88a7442e10cbbe588 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Tue, 27 Apr 2021 23:06:20 +0200 Subject: [PATCH] CLEANUP: channel: No longer notify the producer in co_skip()/co_htx_skip() Thanks to the commit "BUG/MINOR: applet: Notify the other side if data were consumed by an applet", it is no longer necessary to notify the producer when an applet skips output data. Now, it is the default applet handler responsibility to take care of that. --- include/haproxy/channel.h | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/include/haproxy/channel.h b/include/haproxy/channel.h index 65c294fe1..aa1996f4f 100644 --- a/include/haproxy/channel.h +++ b/include/haproxy/channel.h @@ -925,36 +925,26 @@ static inline int32_t channel_htx_fwd_headers(struct channel *chn, struct htx *h * when data have been read directly from the buffer. It is illegal to call * this function with causing a wrapping at the end of the buffer. It's * the caller's responsibility to ensure that is never larger than - * chn->o. Channel flags WRITE_PARTIAL and WROTE_DATA are set. + * chn->o. */ static inline void co_skip(struct channel *chn, int len) { b_del(&chn->buf, len); chn->output -= len; c_realign_if_empty(chn); - - /* notify that some data was written to the SI from the buffer */ - chn->flags |= CF_WRITE_PARTIAL | CF_WROTE_DATA; - chn_prod(chn)->flags &= ~SI_FL_RXBLK_ROOM; // si_rx_room_rdy() } /* 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. + * than bytes can be skipped.. */ 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) { + 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; - chn_prod(chn)->flags &= ~SI_FL_RXBLK_ROOM; // si_rx_room_rdy() - } } /* Tries to copy chunk into the channel's buffer after length controls.