mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 12:43:09 +00:00
bugfix: remove closed connection in gate
This commit is contained in:
@@ -166,10 +166,12 @@ _gen_id(struct gate * g, int connection_id) {
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
_remove_id(struct gate *g, int uid) {
|
_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);
|
assert(conn->uid == uid);
|
||||||
conn->uid = 0;
|
conn->uid = 0;
|
||||||
conn->agent = 0;
|
conn->agent = 0;
|
||||||
|
*pconn = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|||||||
Reference in New Issue
Block a user