From 28e919462b81de447b08c490f9879234642d2200 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Mon, 21 Mar 2022 11:15:30 +0000 Subject: net.connect: Improve logging on connection attempt failure --- net/connect.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'net') diff --git a/net/connect.lua b/net/connect.lua index 0ae9c2b2..f2c932f9 100644 --- a/net/connect.lua +++ b/net/connect.lua @@ -93,9 +93,13 @@ function pending_connection_listeners.ondisconnect(conn, reason) 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 -- cgit v1.2.3