From: Olivier Houchard Date: Tue, 9 Apr 2019 17:14:59 +0000 (+0200) Subject: BUG/MEDIUM: streams: Store prev_state before calling si_update_both(). X-Git-Tag: v2.0-dev3~327 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=120f64a8c4f18c0ab3dc020d9c16371a4babe132;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: streams: Store prev_state before calling si_update_both(). As si_update_both() sets prev_state to state for each stream_interface, if we want to check it changed, copy it before calling si_update_both(). This should be backported to 1.9. --- diff --git a/src/stream.c b/src/stream.c index e19056e21c..70e98b83cc 100644 --- a/src/stream.c +++ b/src/stream.c @@ -2488,14 +2488,18 @@ redo: if (likely((si_f->state != SI_ST_CLO) || (si_b->state > SI_ST_INI && si_b->state < SI_ST_CLO))) { + enum si_state si_b_prev_state, si_f_prev_state; + + si_f_prev_state = si_f->prev_state; + si_b_prev_state = si_b->prev_state; if ((sess->fe->options & PR_O_CONTSTATS) && (s->flags & SF_BE_ASSIGNED)) stream_process_counters(s); si_update_both(si_f, si_b); - if (si_f->state == SI_ST_DIS || si_f->state != si_f->prev_state || - si_b->state == SI_ST_DIS || si_b->state != si_b->prev_state || + if (si_f->state == SI_ST_DIS || si_f->state != si_f_prev_state || + si_b->state == SI_ST_DIS || si_b->state != si_b_prev_state || ((si_f->flags | si_b->flags) & SI_FL_ERR) || (((req->flags ^ rqf_last) | (res->flags ^ rpf_last)) & CF_MASK_ANALYSER)) goto redo;