]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: streams: Don't remove the SI_FL_ERR flag in si_update_both().
authorOlivier Houchard <ohouchard@haproxy.com>
Tue, 9 Apr 2019 17:12:51 +0000 (19:12 +0200)
committerOlivier Houchard <cognet@ci0.org>
Tue, 9 Apr 2019 17:31:22 +0000 (19:31 +0200)
Don't inconditionally remove the SI_FL_ERR code in si_update_both(), which
is called at the end of process_stream(). Doing so was a bug that was there
since the flag was introduced, because we were always setting si->flags to
SI_FL_NONE, however we don't want to lose that one, except if we will retry
connecting, so only remove it in sess_update_st_cer().

This should be backported to 1.9.

src/stream.c
src/stream_interface.c

index 25618aebba1e8669176d1975496f0b3d788e7a61..e19056e21c7cf0e59fea73f14c719e200038322e 100644 (file)
@@ -822,6 +822,7 @@ static int sess_update_st_cer(struct stream *s)
                        si->state = SI_ST_TAR;
                        si->exp = tick_add(now_ms, MS_TO_TICKS(delay));
                }
+               si->flags &= ~SI_FL_ERR;
                return 0;
        }
        return 0;
index 1e944f1f5e13783b3c7cfe06727e85d92c3f9f67..da31482eebeb6f8255df8cb8c0ebfbd03fae8b30 100644 (file)
@@ -830,8 +830,8 @@ void si_update_both(struct stream_interface *si_f, struct stream_interface *si_b
        req->flags &= ~(CF_READ_NULL|CF_READ_PARTIAL|CF_READ_ATTACHED|CF_WRITE_NULL|CF_WRITE_PARTIAL);
        res->flags &= ~(CF_READ_NULL|CF_READ_PARTIAL|CF_READ_ATTACHED|CF_WRITE_NULL|CF_WRITE_PARTIAL);
 
-       si_f->flags &= ~(SI_FL_ERR|SI_FL_EXP);
-       si_b->flags &= ~(SI_FL_ERR|SI_FL_EXP);
+       si_f->flags &= ~SI_FL_EXP;
+       si_b->flags &= ~SI_FL_EXP;
 
        si_f->prev_state = si_f->state;
        si_b->prev_state = si_b->state;