Still working on ConnectTo outgoing connections

This commit is contained in:
thorkill 2015-07-10 02:18:06 +02:00
parent 85bf50612b
commit 970283c148

View file

@ -270,12 +270,12 @@ static void periodic_handler(void *data) {
for list_each(outgoing_t, o, outgoing_list) { for list_each(outgoing_t, o, outgoing_list) {
bool found = false; bool found = false;
for list_each(connection_t, c, connection_list) { for list_each(connection_t, c, connection_list) {
if((c->outgoing == o) && (c->outgoing->keep_it)) { if(c->outgoing == o) {
found = true; found = true;
break; break;
} }
} }
if(!found) { if(!found && !o->keep_it) {
logger(DEBUG_CONNECTIONS, LOG_INFO, "Cancelled outgoing connection to %s", o->name); logger(DEBUG_CONNECTIONS, LOG_INFO, "Cancelled outgoing connection to %s", o->name);
list_delete_node(outgoing_list, node); list_delete_node(outgoing_list, node);
} }