From b2fc04ebef4e7eda23ff445a8b2622f2bb75dec1 Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Thu, 11 Apr 2019 13:56:26 +0200 Subject: [PATCH] BUG/MEDIUM: stream_interface: Don't bother doing chk_rcv/snd if not connected. If the interface is not in state SI_ST_CON or SI_ST_EST, don't bother trying to send/recv data, we can't do it anyway, and if we're in SI_ST_TAR, that may lead to adding the SI_FL_ERR flag back on the stream_interface, while we don't want it. This should be backported to 1.9. --- src/stream_interface.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/stream_interface.c b/src/stream_interface.c index a46368b25..501897a84 100644 --- a/src/stream_interface.c +++ b/src/stream_interface.c @@ -1015,7 +1015,8 @@ static void stream_int_shutw_conn(struct stream_interface *si) static void stream_int_chk_rcv_conn(struct stream_interface *si) { /* (re)start reading */ - tasklet_wakeup(si->wait_event.task); + if (si->state == SI_ST_CON || si->state == SI_ST_EST) + tasklet_wakeup(si->wait_event.task); } @@ -1029,7 +1030,8 @@ static void stream_int_chk_snd_conn(struct stream_interface *si) struct channel *oc = si_oc(si); struct conn_stream *cs = __objt_cs(si->end); - if (unlikely(si->state > SI_ST_EST || (oc->flags & CF_SHUTW))) + if (unlikely((si->state != SI_ST_CON && si->state != SI_ST_EST) || + (oc->flags & CF_SHUTW))) return; if (unlikely(channel_is_empty(oc))) /* called with nothing to send ! */