mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-22 11:03:12 +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->source = addr;
|
||||
p->count++;
|
||||
if (++p->id > MAX_ID) {
|
||||
p->id = id + 1;
|
||||
if (p->id > MAX_ID) {
|
||||
p->id = 1;
|
||||
}
|
||||
assert(s->head == NULL && s->tail == NULL);
|
||||
|
||||
Reference in New Issue
Block a user