-void try_outgoing_connections(meshlink_handle_t *mesh) {
- /* If there is no outgoing list yet, create one. Otherwise, mark all outgoings as deleted. */
-
- if(!mesh->outgoings) {
- mesh->outgoings = list_alloc((list_action_t)free_outgoing);
- } else {
- for list_each(outgoing_t, outgoing, mesh->outgoings) {
- outgoing->timeout = -1;
- }
- }
-
- /* Make sure there is one outgoing_t in the list for each ConnectTo. */
-
- // TODO: Drop support for ConnectTo since AutoConnect is now always on?
- for(config_t *cfg = lookup_config(mesh->config, "ConnectTo"); cfg; cfg = lookup_config_next(mesh->config, cfg)) {
- char *name;
- get_config_string(cfg, &name);
-
- if(!check_id(name)) {
- logger(mesh, MESHLINK_ERROR,
- "Invalid name for outgoing connection in %s line %d",
- cfg->file, cfg->line);
- free(name);
- continue;
- }
-
- bool found = false;
-
- for list_each(outgoing_t, outgoing, mesh->outgoings) {
- if(!strcmp(outgoing->name, name)) {
- found = true;
- outgoing->timeout = 0;
- break;
- }
- }