]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: connection: Don't use the provided conn_stream if it was tried.
authorOlivier Houchard <cognet@ci0.org>
Sat, 8 Dec 2018 15:38:34 +0000 (16:38 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 8 Dec 2018 17:13:46 +0000 (18:13 +0100)
In connect_server(), don't attempt to reuse the conn_stream associated to
the stream_interface, if we already attempted a connection with it.
Using that conn_stream is only there for the cases where a connection and
a conn_stream was created ahead, mostly by http_proxy or by the LUA code.
If we already attempted to connect, that means we fail, and so we should
create a new connection.

No backport needed.

src/backend.c

index 9276fa6b212b5c1440ae3a21f9f5f2db601622d0..46e59eac592fa7d080bb7d01631e4ed924f1b09c 100644 (file)
@@ -1130,7 +1130,8 @@ int connect_server(struct stream *s)
        srv_cs = objt_cs(s->si[1].end);
        if (srv_cs) {
                old_conn = srv_conn = cs_conn(srv_cs);
-               if (old_conn)
+               if (old_conn &&
+                   !(old_conn->flags & (CO_FL_ERROR | CO_FL_WAIT_L4_CONN)))
                        reuse = 1;
        } else {
                for (i = 0; i < MAX_SRV_LIST; i++) {