]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: stream: Don't clear the stream_interface flags in si_update_both.
authorOlivier Houchard <ohouchard@haproxy.com>
Tue, 9 Apr 2019 17:17:41 +0000 (19:17 +0200)
committerOlivier Houchard <cognet@ci0.org>
Tue, 9 Apr 2019 17:31:22 +0000 (19:31 +0200)
In commit d7704b534, we introduced and expiration flag on the stream interface,
which is used for the connect, the queue and the turn around. Because the
turn around state isn't an error, the flag was reset in process_stream(), and
later in commit cff6411f9 when introducing the SI_FL_ERR flag, the cleanup
of the flag at this place was erroneously generalized.
To fix this, the SI_FL_EXP flag is only cleared at the end of the turn around
state, and nobody should clear the stream interface flags anymore.

This should be backported to 1.9, it has no known impact on older versions.

src/stream.c
src/stream_interface.c

index 70e98b83ccab2e49d336712fe4cf5d24f3a1e1b7..cac9a3664081af9f3ca90ad89d1ffc6cfe9f5c59 100644 (file)
@@ -1051,6 +1051,8 @@ static void sess_update_stream_int(struct stream *s)
                if (!(si->flags & SI_FL_EXP))
                        return;  /* still in turn-around */
 
+               si->flags &= ~SI_FL_EXP;
+
                si->exp = TICK_ETERNITY;
 
                /* we keep trying on the same server as long as the stream is
index da31482eebeb6f8255df8cb8c0ebfbd03fae8b30..a46368b25e7a48a0ae6a7c52c66da301c88b1563 100644 (file)
@@ -830,9 +830,6 @@ 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_EXP;
-       si_b->flags &= ~SI_FL_EXP;
-
        si_f->prev_state = si_f->state;
        si_b->prev_state = si_b->state;