From: Olivier Houchard Date: Sat, 8 Dec 2018 15:38:34 +0000 (+0100) Subject: BUG/MEDIUM: connection: Don't use the provided conn_stream if it was tried. X-Git-Tag: v1.9-dev11~146 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eb2bbba547e9185deac06d8d9bcf63f024aca243;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/backend.c b/src/backend.c index 9276fa6b21..46e59eac59 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++) {