This is basically a port of commit
50fcfea1 to 1.1.
return true;
}
+void event_flush_output(void) {
+ for splay_each(io_t, io, &io_tree)
+ if(FD_ISSET(io->fd, &writefds))
+ io->cb(io->data, IO_WRITE);
+}
+
void event_exit(void) {
running = false;
}
extern void signal_del(signal_t *sig);
extern bool event_loop(void);
+extern void event_flush_output(void);
extern void event_exit(void);
#endif
packet.len = len;
packet.priority = 0;
route(myself, &packet);
+ event_flush_output();
LeaveCriticalSection(&mutex);
}
}
}
static void handle_meta_write(connection_t *c) {
+ if(c->outbuf.len <= c->outbuf.offset)
+ return;
+
ssize_t outlen = send(c->socket, c->outbuf.data + c->outbuf.offset, c->outbuf.len - c->outbuf.offset, 0);
if(outlen <= 0) {
if(!errno || errno == EPIPE) {