static void engine_epoll_update(struct IODescriptor *iofd) {
if(iofd->type == IOTYPE_TIMER) return;
+ if(iofd->state == IO_CLOSED) {
+ engine_epoll_remove(iofd);
+ return;
+ }
struct epoll_event evt;
int res;
static void engine_kevent_update(struct IODescriptor *iofd) {
if(iofd->type == IOTYPE_TIMER) return;
+ if(iofd->state == IO_CLOSED) {
+ engine_epoll_remove(iofd);
+ return;
+ }
struct kevent changes[2];
int nchanges = 0;
int res;
#endif
}
else if(iofd->type == IOTYPE_SERVER || iofd->type == IOTYPE_CLIENT) {
+ if(iofd->state == IO_CLOSED)
+ continue;
if(iofd->fd > fds_size)
fds_size = iofd->fd;
FD_SET(iofd->fd, &read_fds);
if(!readable && !writeable) {
callback_event.type = IOEVENT_SSLFAILED;
iofd->state = IO_CLOSED;
+ engine->update(iofd);
} else {
iohandler_log(IOLOG_DEBUG, "triggering iohandler_ssl_client_handshake for %s (fd: %d)", iohandler_iotype_name(iofd->type), iofd->fd);
iohandler_ssl_client_handshake(iofd);