Drop libevent and use our own event handling again.
There are several reasons for this: - MacOS/X doesn't support polling the tap device using kqueue, requiring a workaround to fall back to select(). - On Windows only sockets are properly handled, therefore tinc uses a second thread that does a blocking ReadFile() on the TAP-Win32/64 device. However, this does not mix well with libevent. - Libevent, event just the core, is quite large, and although it is easy to get and install on many platforms, it can be a burden. - Libev is more lightweight and seems technically superior, but it doesn't abstract away all the platform differences (for example, async events are not supported on Windows).
This commit is contained in:
parent
d30b9e1272
commit
6bc5d626a8
28 changed files with 459 additions and 299 deletions
12
src/tincd.c
12
src/tincd.c
|
|
@ -450,18 +450,6 @@ int main2(int argc, char **argv) {
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_DARWIN
|
||||
if(!getenv("EVENT_KQUEUE"))
|
||||
setenv("EVENT_NOKQUEUE", "1", 0);
|
||||
if(!getenv("EVENT_POLL"))
|
||||
setenv("EVENT_NOPOLL", "1", 0);
|
||||
#endif
|
||||
|
||||
if(!event_init()) {
|
||||
logger(DEBUG_ALWAYS, LOG_ERR, "Error initializing libevent!");
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Setup sockets and open device. */
|
||||
|
||||
if(!setup_network())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue