bugfix: remove closed connection in gate

This commit is contained in:
云风
2012-09-06 23:10:40 +08:00
parent 48f8a011a9
commit f8d271c1a0

View File

@@ -166,10 +166,12 @@ _gen_id(struct gate * g, int connection_id) {
static void
_remove_id(struct gate *g, int uid) {
struct connection * conn = _id_to_agent(g,uid);
struct connection ** pconn = &g->agent[uid & (g->cap - 1)];
struct connection * conn = *pconn;
assert(conn->uid == uid);
conn->uid = 0;
conn->agent = 0;
*pconn = NULL;
}
static int