mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-19 20:20:45 +00:00
MINOR: servers: Kill priv_conns.
Remove the list of private connections from server, it has been largely unused, we only inserted connections in it, but we would never actually use it.
This commit is contained in:
parent
751e5e21a9
commit
8676514d4e
@ -221,7 +221,6 @@ struct server {
|
||||
|
||||
struct eb_root pendconns; /* pending connections */
|
||||
struct list actconns; /* active connections */
|
||||
struct list *priv_conns; /* private idle connections attached to stream interfaces */
|
||||
struct list *idle_conns; /* sharable idle connections attached or not to a stream interface */
|
||||
struct list *safe_conns; /* safe idle connections attached to stream interfaces, shared */
|
||||
struct mt_list *idle_orphan_conns; /* Orphan connections idling */
|
||||
|
@ -3613,14 +3613,12 @@ out_uri_auth_compat:
|
||||
for (newsrv = curproxy->srv; newsrv; newsrv = newsrv->next) {
|
||||
int i;
|
||||
|
||||
newsrv->priv_conns = calloc(global.nbthread, sizeof(*newsrv->priv_conns));
|
||||
newsrv->idle_conns = calloc(global.nbthread, sizeof(*newsrv->idle_conns));
|
||||
newsrv->safe_conns = calloc(global.nbthread, sizeof(*newsrv->safe_conns));
|
||||
|
||||
if (!newsrv->priv_conns || !newsrv->idle_conns || !newsrv->safe_conns) {
|
||||
if (!newsrv->idle_conns || !newsrv->safe_conns) {
|
||||
free(newsrv->safe_conns); newsrv->safe_conns = NULL;
|
||||
free(newsrv->idle_conns); newsrv->idle_conns = NULL;
|
||||
free(newsrv->priv_conns); newsrv->priv_conns = NULL;
|
||||
ha_alert("parsing [%s:%d] : failed to allocate idle connections for server '%s'.\n",
|
||||
newsrv->conf.file, newsrv->conf.line, newsrv->id);
|
||||
cfgerr++;
|
||||
@ -3628,7 +3626,6 @@ out_uri_auth_compat:
|
||||
}
|
||||
|
||||
for (i = 0; i < global.nbthread; i++) {
|
||||
LIST_INIT(&newsrv->priv_conns[i]);
|
||||
LIST_INIT(&newsrv->idle_conns[i]);
|
||||
LIST_INIT(&newsrv->safe_conns[i]);
|
||||
}
|
||||
|
@ -2665,7 +2665,6 @@ void deinit(void)
|
||||
free(s->hostname_dn);
|
||||
free((char*)s->conf.file);
|
||||
free(s->idle_conns);
|
||||
free(s->priv_conns);
|
||||
free(s->safe_conns);
|
||||
free(s->idle_orphan_conns);
|
||||
free(s->curr_idle_thr);
|
||||
|
@ -8478,7 +8478,6 @@ void hlua_init(void)
|
||||
socket_tcp.obj_type = OBJ_TYPE_SERVER;
|
||||
LIST_INIT(&socket_tcp.actconns);
|
||||
socket_tcp.pendconns = EB_ROOT;
|
||||
socket_tcp.priv_conns = NULL;
|
||||
socket_tcp.idle_conns = NULL;
|
||||
socket_tcp.safe_conns = NULL;
|
||||
socket_tcp.next_state = SRV_ST_RUNNING; /* early server setup */
|
||||
@ -8524,7 +8523,6 @@ void hlua_init(void)
|
||||
socket_ssl.obj_type = OBJ_TYPE_SERVER;
|
||||
LIST_INIT(&socket_ssl.actconns);
|
||||
socket_ssl.pendconns = EB_ROOT;
|
||||
socket_ssl.priv_conns = NULL;
|
||||
socket_ssl.idle_conns = NULL;
|
||||
socket_ssl.safe_conns = NULL;
|
||||
socket_ssl.next_state = SRV_ST_RUNNING; /* early server setup */
|
||||
|
@ -3503,9 +3503,7 @@ static void fcgi_detach(struct conn_stream *cs)
|
||||
struct server *srv = objt_server(fconn->conn->target);
|
||||
|
||||
if (srv) {
|
||||
if (fconn->conn->flags & CO_FL_PRIVATE)
|
||||
LIST_ADD(&srv->priv_conns[tid], &fconn->conn->list);
|
||||
else
|
||||
if (!(fconn->conn->flags & CO_FL_PRIVATE))
|
||||
LIST_ADD(&srv->idle_conns[tid], &fconn->conn->list);
|
||||
}
|
||||
TRACE_DEVEL("connection in idle server list", FCGI_EV_STRM_END, fconn->conn);
|
||||
|
12
src/mux_h1.c
12
src/mux_h1.c
@ -2425,12 +2425,12 @@ static void h1_detach(struct conn_stream *cs)
|
||||
struct server *srv = objt_server(h1c->conn->target);
|
||||
|
||||
if (srv) {
|
||||
if (h1c->conn->flags & CO_FL_PRIVATE)
|
||||
LIST_ADD(&srv->priv_conns[tid], &h1c->conn->list);
|
||||
else if (is_not_first)
|
||||
LIST_ADD(&srv->safe_conns[tid], &h1c->conn->list);
|
||||
else
|
||||
LIST_ADD(&srv->idle_conns[tid], &h1c->conn->list);
|
||||
if (!(h1c->conn->flags & CO_FL_PRIVATE)) {
|
||||
if (is_not_first)
|
||||
LIST_ADD(&srv->safe_conns[tid], &h1c->conn->list);
|
||||
else
|
||||
LIST_ADD(&srv->idle_conns[tid], &h1c->conn->list);
|
||||
}
|
||||
TRACE_DEVEL("connection in idle server list", H1_EV_STRM_END, h1c->conn);
|
||||
}
|
||||
}
|
||||
|
@ -3901,9 +3901,7 @@ static void h2_detach(struct conn_stream *cs)
|
||||
struct server *srv = objt_server(h2c->conn->target);
|
||||
|
||||
if (srv) {
|
||||
if (h2c->conn->flags & CO_FL_PRIVATE)
|
||||
LIST_ADD(&srv->priv_conns[tid], &h2c->conn->list);
|
||||
else
|
||||
if (!(h2c->conn->flags & CO_FL_PRIVATE))
|
||||
LIST_ADD(&srv->idle_conns[tid], &h2c->conn->list);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user