diff --git a/src/backend.c b/src/backend.c index 3f6e7daa2..e94fc1faf 100644 --- a/src/backend.c +++ b/src/backend.c @@ -1401,6 +1401,9 @@ int connect_server(struct stream *s) if (srv_conn) srv_conn->target = s->target; srv_cs = NULL; + + if ((s->be->options & PR_O_REUSE_MASK) == PR_O_REUSE_NEVR) + conn->flags |= CO_FL_PRIVATE; } if (srv_conn && srv && was_unused) { diff --git a/src/mux_fcgi.c b/src/mux_fcgi.c index 76e93e434..7cd561219 100644 --- a/src/mux_fcgi.c +++ b/src/mux_fcgi.c @@ -3540,9 +3540,6 @@ static void fcgi_detach(struct conn_stream *cs) if (!(fconn->conn->flags & (CO_FL_ERROR|CO_FL_SOCK_RD_SH|CO_FL_SOCK_WR_SH)) && (fconn->flags & FCGI_CF_KEEP_CONN)) { - /* Never ever allow to reuse a connection from a non-reuse backend */ - if ((fconn->proxy->options & PR_O_REUSE_MASK) == PR_O_REUSE_NEVR) - fconn->conn->flags |= CO_FL_PRIVATE; if (fconn->conn->flags & CO_FL_PRIVATE) { if (!fconn->conn->owner) { fconn->conn->owner = sess; diff --git a/src/mux_h1.c b/src/mux_h1.c index 80a7b7db5..6f594410d 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -2453,10 +2453,6 @@ static void h1_detach(struct conn_stream *cs) goto release; } - /* Never ever allow to reuse a connection from a non-reuse backend */ - if ((h1c->px->options & PR_O_REUSE_MASK) == PR_O_REUSE_NEVR) - h1c->conn->flags |= CO_FL_PRIVATE; - if (!(h1c->conn->owner) && (h1c->conn->flags & CO_FL_PRIVATE)) { h1c->conn->owner = sess; if (!session_add_conn(sess, h1c->conn, h1c->conn->target)) { diff --git a/src/mux_h2.c b/src/mux_h2.c index fc35c66a2..22c67b02a 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -3942,9 +3942,6 @@ static void h2_detach(struct conn_stream *cs) if (h2c->flags & H2_CF_IS_BACK) { if (!(h2c->conn->flags & (CO_FL_ERROR | CO_FL_SOCK_RD_SH | CO_FL_SOCK_WR_SH))) { - /* Never ever allow to reuse a connection from a non-reuse backend */ - if ((h2c->proxy->options & PR_O_REUSE_MASK) == PR_O_REUSE_NEVR) - h2c->conn->flags |= CO_FL_PRIVATE; if (h2c->conn->flags & CO_FL_PRIVATE) { if (!h2c->conn->owner) { h2c->conn->owner = sess;