mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
libev set events to match revents
https://github.com/warmcat/libwebsockets/issues/393 Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
parent
5eeb4bd0d3
commit
5783b1a169
1 changed files with 7 additions and 4 deletions
11
lib/libev.c
11
lib/libev.c
|
@ -41,13 +41,16 @@ lws_accept_cb(struct ev_loop *loop, struct ev_io *watcher, int revents)
|
|||
return;
|
||||
|
||||
eventfd.fd = watcher->fd;
|
||||
eventfd.events = 0;
|
||||
eventfd.revents = EV_NONE;
|
||||
if (revents & EV_READ)
|
||||
if (revents & EV_READ) {
|
||||
eventfd.events |= LWS_POLLIN;
|
||||
eventfd.revents |= LWS_POLLIN;
|
||||
|
||||
if (revents & EV_WRITE)
|
||||
}
|
||||
if (revents & EV_WRITE) {
|
||||
eventfd.events |= LWS_POLLOUT;
|
||||
eventfd.revents |= LWS_POLLOUT;
|
||||
|
||||
}
|
||||
lws_service_fd(context, &eventfd);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue