# HG changeset patch # User Matthew Wild # Date 1647861330 0 # Node ID 7a3da1acace11d2ed8802c74bc4e59ae79388ba2 # Parent eabcc3ae22e96853237b3ed7043454e0708dacb1 net.connect: Improve logging on connection attempt failure diff -r eabcc3ae22e9 -r 7a3da1acace1 net/connect.lua --- a/net/connect.lua Mon Mar 21 11:01:58 2022 +0000 +++ b/net/connect.lua Mon Mar 21 11:15:30 2022 +0000 @@ -93,9 +93,13 @@ p.conns[conn] = nil; p.last_error = reason or "unknown reason"; p:log("debug", "Connection attempt failed: %s", p.last_error); - if next(p.conns) == nil and not p.connected then + if p.connected then + p:log("debug", "Connection already established, ignoring failure"); + elseif next(p.conns) == nil then p:log("debug", "No pending connection attempts, and not yet connected"); attempt_connection(p); + else + p:log("debug", "Other attempts are still pending, ignoring failure"); end end