aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2022-04-20 22:41:54 +0200
committerKim Alvefur <zash@zash.se>2022-04-20 22:41:54 +0200
commit9e8e910f1e7be52db27ec26aeb9f39171a6946b5 (patch)
treeb3b8e498f9d4af2966ea97fd600bedc09d8974ac /net
parent7fc174f0457db567ec71e769ccde327d88364cb2 (diff)
downloadprosody-9e8e910f1e7be52db27ec26aeb9f39171a6946b5.tar.gz
prosody-9e8e910f1e7be52db27ec26aeb9f39171a6946b5.zip
net.connect: Fix accumulation of connection attempt references
Connection attempts that failed the Happy Eyeballs race were not unreferenced and would accumulate. Tested by inspecting the 'pending_connections_map' after establishing s2s with a s2s target where the IPv6 port has a -j DROP rule causing it to time out and the IPv4 attempt wins the race. Expected is that the losing connection stays around until net.server timeouts kick in where it should be removed. The map table should tend towards being empty during idle times.
Diffstat (limited to 'net')
-rw-r--r--net/connect.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/connect.lua b/net/connect.lua
index f2c932f9..d85afcff 100644
--- a/net/connect.lua
+++ b/net/connect.lua
@@ -91,6 +91,7 @@ function pending_connection_listeners.ondisconnect(conn, reason)
return;
end
p.conns[conn] = nil;
+ pending_connections_map[conn] = nil;
p.last_error = reason or "unknown reason";
p:log("debug", "Connection attempt failed: %s", p.last_error);
if p.connected then