mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 12:43:09 +00:00
bugfix: socket id alloc
This commit is contained in:
@@ -87,7 +87,8 @@ new_socket(struct socket_pool *p, int sock, uint32_t addr) {
|
|||||||
s->id = id;
|
s->id = id;
|
||||||
s->source = addr;
|
s->source = addr;
|
||||||
p->count++;
|
p->count++;
|
||||||
if (++p->id > MAX_ID) {
|
p->id = id + 1;
|
||||||
|
if (p->id > MAX_ID) {
|
||||||
p->id = 1;
|
p->id = 1;
|
||||||
}
|
}
|
||||||
assert(s->head == NULL && s->tail == NULL);
|
assert(s->head == NULL && s->tail == NULL);
|
||||||
|
|||||||
Reference in New Issue
Block a user