const struct mux_ops *force_mux_ops);
int conn_install_mux_chk(struct connection *conn, void *ctx, struct session *sess);
-void conn_delete_from_tree(struct eb64_node *node);
+void conn_delete_from_tree(struct connection *conn);
void conn_init(struct connection *conn, void *target);
struct connection *conn_new(void *target);
HA_SPIN_LOCK(IDLE_CONNS_LOCK, &idle_conns[tid].idle_conns_lock);
conn = srv_lookup_conn(is_safe ? &srv->per_thr[tid].safe_conns : &srv->per_thr[tid].idle_conns, hash);
if (conn)
- conn_delete_from_tree(&conn->hash_node->node);
+ conn_delete_from_tree(conn);
/* If we failed to pick a connection from the idle list, let's try again with
* the safe list.
if (!conn && !is_safe && srv->curr_safe_nb > 0) {
conn = srv_lookup_conn(&srv->per_thr[tid].safe_conns, hash);
if (conn) {
- conn_delete_from_tree(&conn->hash_node->node);
+ conn_delete_from_tree(conn);
is_safe = 1;
}
}
conn = srv_lookup_conn(is_safe ? &srv->per_thr[i].safe_conns : &srv->per_thr[i].idle_conns, hash);
while (conn) {
if (conn->mux->takeover && conn->mux->takeover(conn, i) == 0) {
- conn_delete_from_tree(&conn->hash_node->node);
+ conn_delete_from_tree(conn);
_HA_ATOMIC_INC(&activity[tid].fd_takeover);
found = 1;
break;
conn = srv_lookup_conn(&srv->per_thr[i].safe_conns, hash);
while (conn) {
if (conn->mux->takeover && conn->mux->takeover(conn, i) == 0) {
- conn_delete_from_tree(&conn->hash_node->node);
+ conn_delete_from_tree(conn);
_HA_ATOMIC_INC(&activity[tid].fd_takeover);
found = 1;
is_safe = 1;
if (node) {
conn_node = ebmb_entry(node, struct conn_hash_node, node);
tokill_conn = conn_node->conn;
- ebmb_delete(node);
+ conn_delete_from_tree(tokill_conn);
HA_SPIN_UNLOCK(IDLE_CONNS_LOCK, &idle_conns[tid].idle_conns_lock);
/* Release the idle lock before calling mux->destroy.
if (node) {
conn_node = ebmb_entry(node, struct conn_hash_node, node);
tokill_conn = conn_node->conn;
- ebmb_delete(node);
+ conn_delete_from_tree(tokill_conn);
}
if (!tokill_conn) {
if (node) {
conn_node = ebmb_entry(node, struct conn_hash_node, node);
tokill_conn = conn_node->conn;
- ebmb_delete(node);
+ conn_delete_from_tree(tokill_conn);
}
}
HA_SPIN_UNLOCK(IDLE_CONNS_LOCK, &idle_conns[i].idle_conns_lock);
if (avail <= 1) {
/* No more streams available, remove it from the list */
HA_SPIN_LOCK(IDLE_CONNS_LOCK, &idle_conns[tid].idle_conns_lock);
- conn_delete_from_tree(&srv_conn->hash_node->node);
+ conn_delete_from_tree(srv_conn);
HA_SPIN_UNLOCK(IDLE_CONNS_LOCK, &idle_conns[tid].idle_conns_lock);
}
/* disables sending of proxy-protocol-v2's LOCAL command */
static int pp2_never_send_local;
-void conn_delete_from_tree(struct eb64_node *node)
+void conn_delete_from_tree(struct connection *conn)
{
- eb64_delete(node);
+ eb64_delete(&conn->hash_node->node);
}
int conn_create_mux(struct connection *conn)
if (conn_in_list) {
HA_SPIN_LOCK(IDLE_CONNS_LOCK, &idle_conns[tid].idle_conns_lock);
- conn_delete_from_tree(&conn->hash_node->node);
+ conn_delete_from_tree(conn);
HA_SPIN_UNLOCK(IDLE_CONNS_LOCK, &idle_conns[tid].idle_conns_lock);
}
conn_in_list = conn_get_idle_flag(conn);
if (conn_in_list)
- conn_delete_from_tree(&conn->hash_node->node);
+ conn_delete_from_tree(conn);
HA_SPIN_UNLOCK(IDLE_CONNS_LOCK, &idle_conns[tid].idle_conns_lock);
} else {
* to steal it from us.
*/
if (fconn->conn->flags & CO_FL_LIST_MASK)
- conn_delete_from_tree(&fconn->conn->hash_node->node);
+ conn_delete_from_tree(fconn->conn);
HA_SPIN_UNLOCK(IDLE_CONNS_LOCK, &idle_conns[tid].idle_conns_lock);
}
*/
conn_in_list = conn_get_idle_flag(conn);
if (conn_in_list)
- conn_delete_from_tree(&conn->hash_node->node);
+ conn_delete_from_tree(conn);
HA_SPIN_UNLOCK(IDLE_CONNS_LOCK, &idle_conns[tid].idle_conns_lock);
} else {
* to steal it from us.
*/
if (h1c->conn->flags & CO_FL_LIST_MASK)
- conn_delete_from_tree(&h1c->conn->hash_node->node);
+ conn_delete_from_tree(h1c->conn);
HA_SPIN_UNLOCK(IDLE_CONNS_LOCK, &idle_conns[tid].idle_conns_lock);
}
*/
conn_in_list = conn_get_idle_flag(conn);
if (conn_in_list)
- conn_delete_from_tree(&conn->hash_node->node);
+ conn_delete_from_tree(conn);
HA_SPIN_UNLOCK(IDLE_CONNS_LOCK, &idle_conns[tid].idle_conns_lock);
} else {
/* connections in error must be removed from the idle lists */
if (conn->flags & CO_FL_LIST_MASK) {
HA_SPIN_LOCK(IDLE_CONNS_LOCK, &idle_conns[tid].idle_conns_lock);
- conn_delete_from_tree(&conn->hash_node->node);
+ conn_delete_from_tree(conn);
HA_SPIN_UNLOCK(IDLE_CONNS_LOCK, &idle_conns[tid].idle_conns_lock);
}
}
/* connections in error must be removed from the idle lists */
if (conn->flags & CO_FL_LIST_MASK) {
HA_SPIN_LOCK(IDLE_CONNS_LOCK, &idle_conns[tid].idle_conns_lock);
- conn_delete_from_tree(&conn->hash_node->node);
+ conn_delete_from_tree(conn);
HA_SPIN_UNLOCK(IDLE_CONNS_LOCK, &idle_conns[tid].idle_conns_lock);
}
}
* to steal it from us.
*/
if (h2c->conn->flags & CO_FL_LIST_MASK)
- conn_delete_from_tree(&h2c->conn->hash_node->node);
+ conn_delete_from_tree(h2c->conn);
HA_SPIN_UNLOCK(IDLE_CONNS_LOCK, &idle_conns[tid].idle_conns_lock);
}
/* in any case this connection must not be considered idle anymore */
if (h2c->conn->flags & CO_FL_LIST_MASK) {
HA_SPIN_LOCK(IDLE_CONNS_LOCK, &idle_conns[tid].idle_conns_lock);
- conn_delete_from_tree(&h2c->conn->hash_node->node);
+ conn_delete_from_tree(h2c->conn);
HA_SPIN_UNLOCK(IDLE_CONNS_LOCK, &idle_conns[tid].idle_conns_lock);
}
/* Remove the connection from any tree (safe, idle or available) */
if (conn->hash_node) {
HA_SPIN_LOCK(IDLE_CONNS_LOCK, &idle_conns[tid].idle_conns_lock);
- conn_delete_from_tree(&conn->hash_node->node);
+ conn_delete_from_tree(conn);
conn->flags &= ~CO_FL_LIST_MASK;
HA_SPIN_UNLOCK(IDLE_CONNS_LOCK, &idle_conns[tid].idle_conns_lock);
}
_HA_ATOMIC_DEC(&srv->curr_used_conns);
HA_SPIN_LOCK(IDLE_CONNS_LOCK, &idle_conns[tid].idle_conns_lock);
- conn_delete_from_tree(&conn->hash_node->node);
+ conn_delete_from_tree(conn);
if (is_safe) {
conn->flags = (conn->flags & ~CO_FL_LIST_MASK) | CO_FL_SAFE_LIST;
conn = ctx->conn;
conn_in_list = conn_get_idle_flag(conn);
if (conn_in_list)
- conn_delete_from_tree(&conn->hash_node->node);
+ conn_delete_from_tree(conn);
HA_SPIN_UNLOCK(IDLE_CONNS_LOCK, &idle_conns[tid].idle_conns_lock);
} else {
conn = ctx->conn;