projects
/
pazpar2-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
549be30
)
Remove connection_freelist
author
Adam Dickmeiss
<adam@indexdata.dk>
Fri, 12 Feb 2010 10:58:46 +0000
(11:58 +0100)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Fri, 12 Feb 2010 10:58:46 +0000
(11:58 +0100)
src/connection.c
patch
|
blob
|
history
diff --git
a/src/connection.c
b/src/connection.c
index
1e37171
..
80ba36b
100644
(file)
--- 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
};
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)
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);
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
}
// 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);
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;
new->host = host;
new->next = new->host->connections;
new->host->connections = new;