Do not disconnect random hosts which are explicit set with ConnectTo

This commit is contained in:
thorkill 2015-07-10 01:43:24 +02:00
parent bdab2e15f6
commit 606948116d
2 changed files with 2 additions and 2 deletions

View file

@ -104,7 +104,6 @@ void terminate_connection(connection_t *c, bool report) {
c->edge = NULL;
/* Run MST and SSSP algorithms */
graph();
/* If the node is not reachable anymore but we remember it had an edge to us, clean it up */
@ -253,7 +252,7 @@ static void periodic_handler(void *data) {
if(i++ != r)
continue;
if(!c->outgoing || !c->node || c->node->edge_tree->count < 2)
if(!c->outgoing || c->outgoing->keep_it || !c->node || c->node->edge_tree->count < 2)
break;
logger(DEBUG_CONNECTIONS, LOG_INFO, "Autodisconnecting from %s", c->name);

View file

@ -122,6 +122,7 @@ typedef struct listen_socket_t {
typedef struct outgoing_t {
char *name;
bool keep_it;
int timeout;
splay_tree_t *config_tree;
struct config_t *cfg;