]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stream-int: factor the SI_ST_EST state test into si_chk_rcv()
authorWilly Tarreau <w@1wt.eu>
Wed, 7 Nov 2018 13:59:45 +0000 (14:59 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 11 Nov 2018 09:18:37 +0000 (10:18 +0100)
This test is made in each implementation of the function, better to
merge it.

include/proto/stream_interface.h
src/stream_interface.c

index a687b2ac6cfec4537b82b49329277a59ce8f39e9..1a70536addee970443ffc4da66fcba28a45fffd4 100644 (file)
@@ -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);
 }
 
index ad9ff9efdb0cb8ecf4beef01a2903209c17f57be..adbdfa8bfc46feaf91a4d021d4268f59fb151169 100644 (file)
@@ -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) {