When installing a mux on the backend, unless we have a good reason for
keeping the session set in conn->owner, we must reset it. Having the
session there just hides potential bugs and prevents certain tests from
being properly done.
Now it is much clearer: conn->owner remains set to the session on
frontend connections, is set to the session when the connection is
private or assimilated private and belongs to the session list, or
is NULL.
if (!mux_ops)
return -1;
}
+
+ /* unless the connection is private or it's temporarily reserved to the
+ * session due to a mux presenting a risk of head-of-line blocking and
+ * the reuse mode is set to "safe", we should reset the owner to avoid
+ * any ambiguity.
+ */
+ if (!(conn->flags & CO_FL_PRIVATE) &&
+ ((prx->options & PR_O_REUSE_MASK) != PR_O_REUSE_SAFE ||
+ !(mux_ops->flags & MX_FL_HOL_RISK)))
+ conn->owner = NULL;
+
return conn_install_mux(conn, mux_ops, ctx, prx, sess);
}