]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: connections: Don't attempt to reuse an unusable connection.
authorOlivier Houchard <ohouchard@haproxy.com>
Thu, 13 Dec 2018 17:01:00 +0000 (18:01 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 13 Dec 2018 17:09:17 +0000 (18:09 +0100)
Before trying to add a connection to the idle list, make sure it doesn't
have the error, the shutr or the shutw flag. If any of them is present,
don't bother trying to recycle the connection, it's going to be destroyed
anyway.

src/proto_http.c

index a89ce1dc06bc1f1198bd4f15ae56fa50689719e8..2b9c0f51e6086e8401da3df810b3895bff1cf344 100644 (file)
@@ -3484,7 +3484,8 @@ void http_end_txn_clean_session(struct stream *s)
         * We then can call si_release_endpoint() to destroy the conn_stream
         */
        if (((s->txn->flags & TX_CON_WANT_MSK) != TX_CON_WANT_KAL) ||
-           !si_conn_ready(&s->si[1]))
+           !si_conn_ready(&s->si[1]) ||
+           (srv_conn && srv_conn->flags & (CO_FL_ERROR | CO_FL_SOCK_RD_SH | CO_FL_SOCK_WR_SH)))
                srv_conn = NULL;
        else if (!srv_conn->owner) {
                srv_conn->owner = s->sess;