/* Check if this was our outgoing connection */
if(outgoing)
- do_outgoing_connection(outgoing);
+ do_outgoing_connection(mesh, outgoing);
#ifndef HAVE_MINGW
/* Clean up dead proxy processes */
*/
static void timeout_handler(event_loop_t *loop, void *data) {
for list_each(connection_t, c, mesh->connections) {
- if(c->last_ping_time + mesh->pingtimeout <= now.tv_sec) {
+ if(c->last_ping_time + mesh->pingtimeout <= mesh->loop.now.tv_sec) {
if(c->status.active) {
if(c->status.pinged) {
- logger(DEBUG_CONNECTIONS, LOG_INFO, "%s (%s) didn't respond to PING in %ld seconds", c->name, c->hostname, (long)now.tv_sec - c->last_ping_time);
- } else if(c->last_ping_time + mesh->pinginterval <= now.tv_sec) {
+ logger(DEBUG_CONNECTIONS, LOG_INFO, "%s (%s) didn't respond to PING in %ld seconds", c->name, c->hostname, (long)mesh->loop.now.tv_sec - c->last_ping_time);
+ } else if(c->last_ping_time + mesh->pinginterval <= mesh->loop.now.tv_sec) {
send_ping(c);
continue;
} else {
outgoing_t *outgoing = xzalloc(sizeof *outgoing);
outgoing->name = xstrdup(n->name);
list_insert_tail(mesh->outgoings, outgoing);
- setup_outgoing_connection(outgoing);
+ setup_outgoing_connection(mesh, outgoing);
}
break;
}
exit_configuration(&mesh->config);
init_configuration(&mesh->config);
- if(!read_server_config()) {
+ if(!read_server_config(mesh)) {
logger(DEBUG_ALWAYS, LOG_ERR, "Unable to reread configuration file.");
return EINVAL;
}
/* Parse some options that are allowed to be changed while tinc is running */
- setup_myself_reloadable();
+ setup_myself_reloadable(mesh);
/* Try to make outgoing connections */
- try_outgoing_connections();
+ try_outgoing_connections(mesh);
/* Close connections to hosts that have a changed or deleted host config file */
}
}
- mesh->last_config_check = now.tv_sec;
+ mesh->last_config_check = mesh->loop.now.tv_sec;
return 0;
}