}
void retry_outgoing(meshlink_handle_t *mesh, outgoing_t *outgoing) {
- if(!mesh->reachable && mesh->loop.now.tv_sec < mesh->last_unreachable + mesh->dev_class_traits[mesh->devclass].fast_retry_period) {
+ if(!mesh->reachable && mesh->loop.now.tv_sec < mesh->last_unreachable + mesh->dev_class_traits[outgoing->node->devclass].fast_retry_period) {
outgoing->timeout = 1;
} else {
outgoing->timeout += 5;
}
}
+void flush_meta(meshlink_handle_t *mesh, connection_t *c) {
+ handle_meta_write(mesh, c);
+}
+
static void handle_meta_io(event_loop_t *loop, void *data, int flags) {
meshlink_handle_t *mesh = loop->data;
connection_t *c = data;
outgoing->ai = NULL;
outgoing->aip = NULL;
- outgoing->state = OUTGOING_RECENT;
+ outgoing->state = OUTGOING_END;
}
if(outgoing->state == OUTGOING_RECENT) {
fd = accept(l->tcp.fd, &sa.sa, &len);
if(fd < 0) {
+ if(sockwouldblock(errno)) {
+ return;
+ }
+
if(errno == EINVAL) { // TODO: check if Windows agrees
event_loop_stop(loop);
return;