forked from mirrors/kore
Add EV_CLEAR to the bsd event code for kqueue.
This was missing and makes dealing with events easier.
This commit is contained in:
parent
c322bbd3c8
commit
0e3271cf9d
13
src/bsd.c
13
src/bsd.c
|
@ -176,15 +176,8 @@ kore_platform_event_wait(u_int64_t timer)
|
||||||
!(c->flags & CONN_WRITE_BLOCK))
|
!(c->flags & CONN_WRITE_BLOCK))
|
||||||
c->flags |= CONN_WRITE_POSSIBLE;
|
c->flags |= CONN_WRITE_POSSIBLE;
|
||||||
|
|
||||||
if (!kore_connection_handle(c)) {
|
if (!kore_connection_handle(c))
|
||||||
kore_connection_disconnect(c);
|
kore_connection_disconnect(c);
|
||||||
} else {
|
|
||||||
if (!TAILQ_EMPTY(&(c->send_queue))) {
|
|
||||||
kore_platform_event_schedule(c->fd,
|
|
||||||
EVFILT_WRITE, EV_ADD | EV_ONESHOT,
|
|
||||||
c);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
#if defined(KORE_USE_PGSQL)
|
#if defined(KORE_USE_PGSQL)
|
||||||
case KORE_TYPE_PGSQL_CONN:
|
case KORE_TYPE_PGSQL_CONN:
|
||||||
|
@ -207,8 +200,8 @@ kore_platform_event_wait(u_int64_t timer)
|
||||||
void
|
void
|
||||||
kore_platform_event_all(int fd, void *c)
|
kore_platform_event_all(int fd, void *c)
|
||||||
{
|
{
|
||||||
kore_platform_event_schedule(fd, EVFILT_READ, EV_ADD, c);
|
kore_platform_event_schedule(fd, EVFILT_READ, EV_ADD | EV_CLEAR, c);
|
||||||
kore_platform_event_schedule(fd, EVFILT_WRITE, EV_ADD | EV_ONESHOT, c);
|
kore_platform_event_schedule(fd, EVFILT_WRITE, EV_ADD | EV_CLEAR, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in New Issue