From 9ecd8773a367e0fae79a2da422a0bebb0938fe1e Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 12 Feb 2010 11:58:46 +0100 Subject: [PATCH] Remove connection_freelist --- src/connection.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/connection.c b/src/connection.c index 1e37171..80ba36b 100644 --- a/src/connection.c +++ b/src/connection.c @@ -66,8 +66,6 @@ struct connection { struct connection *next; // next for same host or next in free list }; -static struct connection *connection_freelist = 0; /* thread pr */ - static int connection_connect(struct connection *con, iochan_man_t iochan_man); static int connection_is_idle(struct connection *co) @@ -124,9 +122,7 @@ void connection_destroy(struct connection *co) client_disconnect(co->client); } xfree(co->zproxy); - co->zproxy = 0; - co->next = connection_freelist; - connection_freelist = co; + xfree(co); } // Creates a new connection for client, associated with the host of @@ -139,12 +135,7 @@ static struct connection *connection_create(struct client *cl, struct connection *new; struct host *host = client_get_host(cl); - if ((new = connection_freelist)) - connection_freelist = new->next; - else - { - new = xmalloc(sizeof (struct connection)); - } + new = xmalloc(sizeof(*new)); new->host = host; new->next = new->host->connections; new->host->connections = new; -- 1.7.10.4