mirror of https://git.kore.io/kore.git
Add task glue for BSD as well
This commit is contained in:
parent
fff0a763ae
commit
a54d04eb8a
29
src/bsd.c
29
src/bsd.c
|
@ -27,6 +27,10 @@
|
|||
#include "kore_pgsql.h"
|
||||
#endif
|
||||
|
||||
#if defined(KORE_USE_TASKS)
|
||||
#include "kore_tasks.h"
|
||||
#endif
|
||||
|
||||
static int kfd = -1;
|
||||
static struct kevent *events;
|
||||
static u_int32_t nchanges;
|
||||
|
@ -108,18 +112,26 @@ kore_platform_event_wait(void)
|
|||
|
||||
if (events[i].flags & EV_EOF ||
|
||||
events[i].flags & EV_ERROR) {
|
||||
if (type == KORE_TYPE_LISTENER)
|
||||
switch (type) {
|
||||
case KORE_TYPE_LISTENER:
|
||||
fatal("error on server socket");
|
||||
|
||||
/* NOTREACHED */
|
||||
#if defined(KORE_USE_PGSQL)
|
||||
if (type == KORE_TYPE_PGSQL_CONN) {
|
||||
case KORE_TYPE_PGSQL_CONN:
|
||||
kore_pgsql_handle(events[i].udata, 1);
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if defined(KORE_USE_TASKS)
|
||||
case KORE_TYPE_TASK:
|
||||
kore_task_handle(events[i].udata, 1);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
c = (struct connection *)events[i].udata;
|
||||
kore_connection_disconnect(c);
|
||||
break;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -164,6 +176,11 @@ kore_platform_event_wait(void)
|
|||
case KORE_TYPE_PGSQL_CONN:
|
||||
kore_pgsql_handle(events[i].udata, 0);
|
||||
break;
|
||||
#endif
|
||||
#if defined(KORE_USE_TASKS)
|
||||
case KORE_TYPE_TASK:
|
||||
kore_task_handle(events[i].udata, 0);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
fatal("wrong type in event %d", type);
|
||||
|
|
Loading…
Reference in New Issue