|
|
@ -373,15 +373,24 @@ llarp_kqueue_loop::tick(int ms)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
llarp::ev_io* ev = static_cast< llarp::ev_io* >(events[idx].udata);
|
|
|
|
llarp::ev_io* ev = static_cast< llarp::ev_io* >(events[idx].udata);
|
|
|
|
if(ev)
|
|
|
|
if(ev)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if(events[idx].filter & EV_ERROR)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ev->error();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if(events[idx.filter] & EV_EOF == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(events[idx].filter & EVFILT_WRITE)
|
|
|
|
if(events[idx].filter & EVFILT_WRITE)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ev->flush_write_buffers(events[idx].data);
|
|
|
|
ev->flush_write_buffers(events[idx].data);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(events[idx].filter & EVFILT_READ)
|
|
|
|
if(events[idx].filter & EVFILT_READ)
|
|
|
|
|
|
|
|
{
|
|
|
|
ev->read(readbuf,
|
|
|
|
ev->read(readbuf,
|
|
|
|
std::min(sizeof(readbuf), size_t(events[idx].data)));
|
|
|
|
std::min(sizeof(readbuf), size_t(events[idx].data)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
++idx;
|
|
|
|
++idx;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|