BUG/MEDIUM: servers: Don't try to reuse connection if we switched server.

In connect_server(), don't attempt to reuse the old connection if it's
targetting a different server than the one we're supposed to access, or
we will never be able to connect to a server if the first one we tried failed.

This should be backported to 1.9.
This commit is contained in:
Olivier Houchard 2018-12-24 13:32:13 +01:00 committed by Willy Tarreau
parent 48507ef558
commit bb3dac37a2

View File

@ -1129,7 +1129,7 @@ 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->target || old_conn->target == s->target)) {
old_conn->flags &= ~(CO_FL_ERROR | CO_FL_SOCK_RD_SH | CO_FL_SOCK_WR_SH);
srv_cs->flags &= ~(CS_FL_ERROR | CS_FL_EOS | CS_FL_REOS);
reuse = 1;