fix: the cpu usage of pn_listen thread reaches 100 percent
This commit is contained in:
parent
6f318f70d3
commit
1d4a6804a0
3
deps/oblib/src/rpc/pnio/nio/listener.c
vendored
3
deps/oblib/src/rpc/pnio/nio/listener.c
vendored
@ -74,7 +74,7 @@ static int dispatch_handle_event(dispatch_sk_t* s)
|
||||
err = EIO;
|
||||
}
|
||||
} else if ((uint64_t)rbytes < sizeof(dispatch_head_t)) {
|
||||
// do nothing;
|
||||
err = EAGAIN;
|
||||
} else if (h->magic != DISPATCH_MAGIC) {
|
||||
listen_t* l = structof(s->fty, listen_t, sf);
|
||||
int fd = 0;
|
||||
@ -98,6 +98,7 @@ static int dispatch_handle_event(dispatch_sk_t* s)
|
||||
err = -EINVAL;
|
||||
} else if (h->len + sizeof(*h) > (uint64_t)rbytes) {
|
||||
// need read more
|
||||
err = EAGAIN;
|
||||
} else {
|
||||
err = call_dispatch_func(s, (const char*)(h+1), h->len);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user