]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: connection: Just make sure we closed the fd on connection failure.
authorOlivier Houchard <ohouchard@haproxy.com>
Thu, 13 Dec 2018 14:40:16 +0000 (15:40 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 13 Dec 2018 16:32:15 +0000 (17:32 +0100)
When the connection failed, we don't really want to close the conn_stream,
as we're probably about to retry, so just make sure the file descriptor is
closed.

src/stream.c

index 2e8d75562e7175069c8d100a1b63e4fb87740a8a..7c2a63aca358957d2a9b929c28a93b1734a7e127 100644 (file)
@@ -650,11 +650,10 @@ static int sess_update_st_con_tcp(struct stream *s)
                si->state = SI_ST_CER;
 
                if (srv_cs)
-                       cs_close(srv_cs);
-               else if (conn) {
+                       conn = srv_cs->conn;
+               if (conn) {
                        conn_stop_tracking(conn);
                        conn_full_close(conn);
-                       conn_free(conn);
                }
 
                if (si->err_type)