mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-29 23:01:03 +01:00
MINOR: connections: Make the "list" element a struct mt_list instead of list.
Make the "list" element a struct mt_list, and explicitely use list_from_mt_list to get a struct list * where it is used as such, so that mt_list_for_each_entry will be usable with it.
This commit is contained in:
parent
00bdce24d5
commit
f0d4dff25c
@ -318,7 +318,7 @@ static inline void conn_init(struct connection *conn)
|
|||||||
conn->target = NULL;
|
conn->target = NULL;
|
||||||
conn->destroy_cb = NULL;
|
conn->destroy_cb = NULL;
|
||||||
conn->proxy_netns = NULL;
|
conn->proxy_netns = NULL;
|
||||||
LIST_INIT(&conn->list);
|
MT_LIST_INIT(&conn->list);
|
||||||
LIST_INIT(&conn->session_list);
|
LIST_INIT(&conn->session_list);
|
||||||
conn->subs = NULL;
|
conn->subs = NULL;
|
||||||
conn->idle_time = 0;
|
conn->idle_time = 0;
|
||||||
|
|||||||
@ -261,7 +261,7 @@ static inline int srv_add_to_idle_list(struct server *srv, struct connection *co
|
|||||||
_HA_ATOMIC_SUB(&srv->curr_idle_conns, 1);
|
_HA_ATOMIC_SUB(&srv->curr_idle_conns, 1);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
LIST_DEL_INIT(&conn->list);
|
MT_LIST_DEL(&conn->list);
|
||||||
MT_LIST_ADDQ(is_safe ? &srv->safe_conns[tid] : &srv->idle_conns[tid],
|
MT_LIST_ADDQ(is_safe ? &srv->safe_conns[tid] : &srv->idle_conns[tid],
|
||||||
(struct mt_list *)&conn->list);
|
(struct mt_list *)&conn->list);
|
||||||
srv->curr_idle_thr[tid]++;
|
srv->curr_idle_thr[tid]++;
|
||||||
|
|||||||
@ -458,7 +458,7 @@ struct connection {
|
|||||||
|
|
||||||
/* second cache line */
|
/* second cache line */
|
||||||
struct wait_event *subs; /* Task to wake when awaited events are ready */
|
struct wait_event *subs; /* Task to wake when awaited events are ready */
|
||||||
struct list list; /* attach point to various connection lists (idle, ...) */
|
struct mt_list list; /* attach point to various connection lists (idle, ...) */
|
||||||
struct list session_list; /* List of attached connections to a session */
|
struct list session_list; /* List of attached connections to a session */
|
||||||
union conn_handle handle; /* connection handle at the socket layer */
|
union conn_handle handle; /* connection handle at the socket layer */
|
||||||
const struct netns_entry *proxy_netns;
|
const struct netns_entry *proxy_netns;
|
||||||
|
|||||||
@ -1251,7 +1251,7 @@ int connect_server(struct stream *s)
|
|||||||
_HA_ATOMIC_SUB(&srv->curr_idle_conns, 1);
|
_HA_ATOMIC_SUB(&srv->curr_idle_conns, 1);
|
||||||
__ha_barrier_atomic_store();
|
__ha_barrier_atomic_store();
|
||||||
srv->curr_idle_thr[tid]--;
|
srv->curr_idle_thr[tid]--;
|
||||||
LIST_ADDQ(&srv->available_conns[tid], &srv_conn->list);
|
LIST_ADDQ(&srv->available_conns[tid], mt_list_to_list(&srv_conn->list));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (srv_conn->flags & CO_FL_SESS_IDLE) {
|
if (srv_conn->flags & CO_FL_SESS_IDLE) {
|
||||||
@ -1269,8 +1269,7 @@ int connect_server(struct stream *s)
|
|||||||
|
|
||||||
if (avail <= 1) {
|
if (avail <= 1) {
|
||||||
/* No more streams available, remove it from the list */
|
/* No more streams available, remove it from the list */
|
||||||
LIST_DEL(&srv_conn->list);
|
MT_LIST_DEL(&srv_conn->list);
|
||||||
LIST_INIT(&srv_conn->list);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (avail >= 1) {
|
if (avail >= 1) {
|
||||||
@ -1404,7 +1403,7 @@ int connect_server(struct stream *s)
|
|||||||
*/
|
*/
|
||||||
if (srv && ((s->be->options & PR_O_REUSE_MASK) == PR_O_REUSE_ALWS) &&
|
if (srv && ((s->be->options & PR_O_REUSE_MASK) == PR_O_REUSE_ALWS) &&
|
||||||
srv_conn->mux->avail_streams(srv_conn) > 0)
|
srv_conn->mux->avail_streams(srv_conn) > 0)
|
||||||
LIST_ADD(&srv->available_conns[tid], &srv_conn->list);
|
LIST_ADDQ(&srv->available_conns[tid], mt_list_to_list(&srv_conn->list));
|
||||||
}
|
}
|
||||||
/* The CO_FL_SEND_PROXY flag may have been set by the connect method,
|
/* The CO_FL_SEND_PROXY flag may have been set by the connect method,
|
||||||
* if so, add our handshake pseudo-XPRT now.
|
* if so, add our handshake pseudo-XPRT now.
|
||||||
|
|||||||
@ -55,7 +55,7 @@ int conn_create_mux(struct connection *conn)
|
|||||||
srv = objt_server(conn->target);
|
srv = objt_server(conn->target);
|
||||||
if (srv && ((srv->proxy->options & PR_O_REUSE_MASK) != PR_O_REUSE_NEVR) &&
|
if (srv && ((srv->proxy->options & PR_O_REUSE_MASK) != PR_O_REUSE_NEVR) &&
|
||||||
conn->mux->avail_streams(conn) > 0)
|
conn->mux->avail_streams(conn) > 0)
|
||||||
LIST_ADD(&srv->available_conns[tid], &conn->list);
|
LIST_ADDQ(&srv->available_conns[tid], mt_list_to_list(&conn->list));
|
||||||
return 0;
|
return 0;
|
||||||
fail:
|
fail:
|
||||||
/* let the upper layer know the connection failed */
|
/* let the upper layer know the connection failed */
|
||||||
|
|||||||
@ -3507,9 +3507,9 @@ static void fcgi_detach(struct conn_stream *cs)
|
|||||||
TRACE_DEVEL("reusable idle connection", FCGI_EV_STRM_END, fconn->conn);
|
TRACE_DEVEL("reusable idle connection", FCGI_EV_STRM_END, fconn->conn);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (LIST_ISEMPTY(&fconn->conn->list) &&
|
} else if (MT_LIST_ISEMPTY(&fconn->conn->list) &&
|
||||||
fcgi_avail_streams(fconn->conn) > 0 && objt_server(fconn->conn->target)) {
|
fcgi_avail_streams(fconn->conn) > 0 && objt_server(fconn->conn->target)) {
|
||||||
LIST_ADD(&__objt_server(fconn->conn->target)->available_conns[tid], &fconn->conn->list);
|
LIST_ADD(&__objt_server(fconn->conn->target)->available_conns[tid], mt_list_to_list(&fconn->conn->list));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3906,9 +3906,9 @@ static void h2_detach(struct conn_stream *cs)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
} else if (LIST_ISEMPTY(&h2c->conn->list) &&
|
} else if (MT_LIST_ISEMPTY(&h2c->conn->list) &&
|
||||||
h2_avail_streams(h2c->conn) > 0 && objt_server(h2c->conn->target)) {
|
h2_avail_streams(h2c->conn) > 0 && objt_server(h2c->conn->target)) {
|
||||||
LIST_ADD(&__objt_server(h2c->conn->target)->available_conns[tid], &h2c->conn->list);
|
LIST_ADD(&__objt_server(h2c->conn->target)->available_conns[tid], mt_list_to_list(&h2c->conn->list));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user