Changeset

12426:7a3da1acace1

net.connect: Improve logging on connection attempt failure
author Matthew Wild <mwild1@gmail.com>
date Mon, 21 Mar 2022 11:15:30 +0000
parents 12425:eabcc3ae22e9
children 12428:ba5bf1d9d9bd
files net/connect.lua
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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