From f58e8679e74a30d068e529cce2d5cc7031ab122b Mon Sep 17 00:00:00 2001
From: thorkill <thkr@hannover.ccc.de>
Date: Tue, 24 Nov 2015 16:55:03 +0100
Subject: [PATCH] Revert "Working on fix "stuck" outgoing connections."

This reverts commit 703ed7fff6353a23d62f147d4e24869db57ca9ef.
---
 src/net.c        | 12 +-----------
 src/net.h        |  1 -
 src/net_socket.c |  2 --
 3 files changed, 1 insertion(+), 14 deletions(-)

diff --git a/src/net.c b/src/net.c
index 573d1f2d..881c6b64 100644
--- a/src/net.c
+++ b/src/net.c
@@ -228,7 +228,7 @@ static void periodic_handler(void *data) {
 				}
 				if (!found)
 					splay_insert(tmp_node_tree, n);
-			}
+				}
 
 			if (tmp_node_tree->count) {
 				int r = rand() % tmp_node_tree->count;
@@ -242,21 +242,11 @@ static void periodic_handler(void *data) {
 						logger(DEBUG_CONNECTIONS, LOG_INFO, "Autoconnecting to %s", n->name);
 						outgoing_t *outgoing = xzalloc(sizeof *outgoing);
 						outgoing->name = xstrdup(n->name);
-						outgoing->is_alive = true;
 						list_insert_tail(outgoing_list, outgoing);
 						setup_outgoing_connection(outgoing);
 					}
 			} else {
 				logger(DEBUG_ALWAYS, LOG_INFO, "No more nodes available for autoconnect!");
-				for list_each(outgoing_t, outgoing, outgoing_list) {
-					/*
-					It looks like this connection "died" bacause of missing hostname->addr lookup.
-					Remove it and try again.
-					*/
-					if (!outgoing->is_alive) {
-						list_delete(outgoing_list, outgoing);
-					}
-				}
 			}
 			splay_delete_tree(tmp_node_tree);
 		} else if(nc > 3) {
diff --git a/src/net.h b/src/net.h
index 956240ef..3f9bc40c 100644
--- a/src/net.h
+++ b/src/net.h
@@ -123,7 +123,6 @@ typedef struct listen_socket_t {
 typedef struct outgoing_t {
 	char *name;
 	bool keep_it;
-	bool is_alive;
 	int timeout;
 	splay_tree_t *config_tree;
 	struct config_t *cfg;
diff --git a/src/net_socket.c b/src/net_socket.c
index 081626a9..290f42e4 100644
--- a/src/net_socket.c
+++ b/src/net_socket.c
@@ -620,8 +620,6 @@ void setup_outgoing_connection(outgoing_t *outgoing) {
 			outgoing->aip = outgoing->ai = get_known_addresses(n);
 		if(!outgoing->ai) {
 			logger(DEBUG_ALWAYS, LOG_DEBUG, "No address known for %s", outgoing->name);
-			retry_outgoing(outgoing);
-			outgoing->is_alive = false;
 			return;
 		}
 	}