aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2022-03-21 11:15:30 +0000
committerMatthew Wild <mwild1@gmail.com>2022-03-21 11:15:30 +0000
commit28e919462b81de447b08c490f9879234642d2200 (patch)
treea48dc496e67e9223ed517819e1c9eef7328fed13
parentb42fe8746c442351e0330c4570b0ae7eba102fe8 (diff)
downloadprosody-28e919462b81de447b08c490f9879234642d2200.tar.gz
prosody-28e919462b81de447b08c490f9879234642d2200.zip
net.connect: Improve logging on connection attempt failure
-rw-r--r--net/connect.lua6
1 files changed, 5 insertions, 1 deletions
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