BUG/MEDIUM: servers: Don't forget to set srv_cs to NULL if we can't reuse it.

In connect_server(), if there were already a CS assosciated with the stream,
but we can't reuse it, because the target is different (because we tried a
previous connection, it failed, and we use redispatch so we switched servers),
don't forget to set srv_cs to NULL. Otherwise, if we end up reusing another
connection, we would consider we already have a conn_stream, and we won't
create a new one, so we'd have a new connection but we would not be able to
use it.
This can explain frozen streams and connections stuck in CLOSE_WAIT when
using redispatch.

This should be backported to 1.9 and 2.0.

(cherry picked from commit a1ab97316f34dc3b478cd076b76b01c0e23b8769)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
1 file changed