X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=src%2Fevent.c;h=59b96e37dc3f7d3c7fa80ed96d27be1326a915c9;hp=60d357d4a09b6898ef0b0483c498e144d639bc50;hb=706d855e507980de3845556989d7de7a3b9c76e8;hpb=163773d7107b7726bed24cb1c31b1cecc0d0c239 diff --git a/src/event.c b/src/event.c index 60d357d4..59b96e37 100644 --- a/src/event.c +++ b/src/event.c @@ -285,6 +285,16 @@ bool event_loop(void) { io->cb(io->data, IO_WRITE); else if(FD_ISSET(io->fd, &readable)) io->cb(io->data, IO_READ); + else + continue; + + /* + There are scenarios in which the callback will remove another io_t from the tree + (e.g. closing a double connection). Since splay_each does not support that, we + need to exit the loop now. That's okay, since any remaining events will get picked + up by the next select() call. + */ + break; } } #else