backoff retries for late-failing connections

If a connection gets through all the handshake and subsequent checks -
i.e. it ends up getting added to the LocalPeer's connection list - but
gets terminated within one minute (of the start of the successful
connection attempt), then we apply the existing backoff logic to
schedule a retry, instead of retrying immediately.

In order to do this we retain the 'Target' data structure for such
connections, marking it as 'connected' instead of deleting it (as we
did previously).

Fixes #953.
This commit is contained in:
Matthias Radestock committed 2015-10-01 20:05:12 +01:00
1 parent d547829c5f
commit 520c7286c4
2 files changed
+27 -15

No files matched your search

+2
View File
@@ -175,6 +175,8 @@ func NewLocalConnectionStatusSlice(cm *ConnectionMaker) []LocalConnectionStatus
for address, target := range cm.targets {
var state, info string
switch {
case target.connected:
continue
case target.lastError == nil:
state = "connecting"
info = ""