From: Willy Tarreau Date: Wed, 7 Nov 2018 13:59:45 +0000 (+0100) Subject: MINOR: stream-int: factor the SI_ST_EST state test into si_chk_rcv() X-Git-Tag: v1.9-dev6~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1bdb598a55fe5e0bd209459754c60008bd95f7a9;p=thirdparty%2Fhaproxy.git MINOR: stream-int: factor the SI_ST_EST state test into si_chk_rcv() This test is made in each implementation of the function, better to merge it. --- diff --git a/include/proto/stream_interface.h b/include/proto/stream_interface.h index a687b2ac6c..1a70536add 100644 --- a/include/proto/stream_interface.h +++ b/include/proto/stream_interface.h @@ -396,6 +396,9 @@ static inline void si_chk_rcv(struct stream_interface *si) if (!(si->flags & SI_FL_WANT_PUT)) return; + if (si->state > SI_ST_EST) + return; + si->ops->chk_rcv(si); } diff --git a/src/stream_interface.c b/src/stream_interface.c index ad9ff9efdb..adbdfa8bfc 100644 --- a/src/stream_interface.c +++ b/src/stream_interface.c @@ -248,7 +248,7 @@ static void stream_int_chk_rcv(struct stream_interface *si) __FUNCTION__, si, si->state, ic->flags, si_oc(si)->flags); - if (unlikely(si->state != SI_ST_EST || (ic->flags & (CF_SHUTR|CF_DONT_READ)))) + if (ic->flags & (CF_SHUTR|CF_DONT_READ)) return; if (!channel_may_recv(ic) || ic->pipe) { @@ -960,7 +960,7 @@ static void stream_int_chk_rcv_conn(struct stream_interface *si) { struct channel *ic = si_ic(si); - if (unlikely(si->state > SI_ST_EST || (ic->flags & CF_SHUTR))) + if (ic->flags & CF_SHUTR) return; if ((ic->flags & CF_DONT_READ) || !channel_may_recv(ic)) { @@ -1498,7 +1498,7 @@ static void stream_int_chk_rcv_applet(struct stream_interface *si) __FUNCTION__, si, si->state, ic->flags, si_oc(si)->flags); - if (unlikely(si->state != SI_ST_EST || (ic->flags & (CF_SHUTR|CF_DONT_READ)))) + if (ic->flags & (CF_SHUTR|CF_DONT_READ)) return; if (channel_may_recv(ic) && !ic->pipe) {