void (*cleanup)(void);
};
-#define iohandler_wants_writes(IOFD) (IOFD->writebuf.bufpos || IOFD->state == IO_CONNECTING)
+#define iohandler_wants_writes(IOFD) ((IOFD->writebuf.bufpos && !IOFD->ssl_hs_read) || IOFD->state == IO_CONNECTING || IOFD->ssl_hs_write)
void iohandler_log(enum IOLogType type, char *text, ...);
void iohandler_events(struct IODescriptor *iofd, int readable, int writeable);