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:
Olivier Houchard 2020-01-02 18:10:17 +01:00 committed by Olivier Houchard
parent 751e5e21a9
commit 8676514d4e
7 changed files with 9 additions and 20 deletions

View File

@ -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 */

View File

@ -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]);
}

View File

@ -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);

View File

@ -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 */

View File

@ -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);

View File

@ -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);
}
}

View File

@ -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);
}