From eb2bbba547e9185deac06d8d9bcf63f024aca243 Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Sat, 8 Dec 2018 16:38:34 +0100 Subject: [PATCH] BUG/MEDIUM: connection: Don't use the provided conn_stream if it was tried. 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/backend.c b/src/backend.c index 9276fa6b2..46e59eac5 100644 --- a/src/backend.c +++ b/src/backend.c @@ -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++) {