static vine_epoll_io_event_handler *io_event_handlers[MAX_IO_EVENT_HANDLERS] = {0, };
+static vine_epoll_io_event_handler *_find_io_event_handler(int fd);
+
static void *__vine_event_loop_epoll_run(void *arg)
{
VINE_LOGD("Run Vine event loop");
}
for (int i = 0; i < n; ++i) {
+ if (_find_io_event_handler(events[i].data.fd) == NULL) {
+ VINE_LOGI("Removed fd[%d]", events[i].data.fd);
+ continue;
+ }
+
vine_epoll_io_event_handler *h = (vine_epoll_io_event_handler *)events[i].data.ptr;
if (h && h->fd > 0 && h->handler)
h->handler(h->fd, events[i].events, h->user_data);
static vine_epoll_io_event_handler *_find_io_event_handler(int fd)
{
+ if (fd < 0 || fd >= MAX_IO_EVENT_HANDLERS)
+ return NULL;
return io_event_handlers[fd];
}