Don't leave dead outgoing_t's in the outgoing_list.
If an outgoing connection cannot be made because no address is known for it, it should be removed from the outgoing_list, otherwise it will prevent it from being re-added later when we do know addresses for it.
This commit is contained in:
parent
c58eba587d
commit
9fdf4278f8
1 changed files with 12 additions and 4 deletions
|
@ -604,9 +604,12 @@ void setup_outgoing_connection(outgoing_t *outgoing) {
|
||||||
|
|
||||||
if(n && n->connection) {
|
if(n && n->connection) {
|
||||||
logger(DEBUG_CONNECTIONS, LOG_INFO, "Already connected to %s", outgoing->name);
|
logger(DEBUG_CONNECTIONS, LOG_INFO, "Already connected to %s", outgoing->name);
|
||||||
|
if(!n->connection->outgoing) {
|
||||||
n->connection->outgoing = outgoing;
|
n->connection->outgoing = outgoing;
|
||||||
return;
|
return;
|
||||||
|
} else {
|
||||||
|
goto remove;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
init_configuration(&outgoing->config_tree);
|
init_configuration(&outgoing->config_tree);
|
||||||
|
@ -618,11 +621,16 @@ void setup_outgoing_connection(outgoing_t *outgoing) {
|
||||||
outgoing->aip = outgoing->ai = get_known_addresses(n);
|
outgoing->aip = outgoing->ai = get_known_addresses(n);
|
||||||
if(!outgoing->ai) {
|
if(!outgoing->ai) {
|
||||||
logger(DEBUG_ALWAYS, LOG_DEBUG, "No address known for %s", outgoing->name);
|
logger(DEBUG_ALWAYS, LOG_DEBUG, "No address known for %s", outgoing->name);
|
||||||
return;
|
goto remove;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
do_outgoing_connection(outgoing);
|
do_outgoing_connection(outgoing);
|
||||||
|
return;
|
||||||
|
|
||||||
|
remove:
|
||||||
|
list_delete(outgoing_list, outgoing);
|
||||||
|
free(outgoing);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue