# HG changeset patch # User Matthew Wild # Date 1342970224 -3600 # Node ID 1722a6bea11546fe46d089ae21dd7e567fc9b751 # Parent 4f1b6a4784f92d351f77710f66c48fb56adeff83 mod_s2s/s2sout.lib: Don't wait for both v4 and v6 DNS responses if we only send one (e.g. because v6 is disabled) diff -r 4f1b6a4784f9 -r 1722a6bea115 plugins/mod_s2s/s2sout.lib.lua --- a/plugins/mod_s2s/s2sout.lib.lua Thu Jul 19 15:36:16 2012 +0100 +++ b/plugins/mod_s2s/s2sout.lib.lua Sun Jul 22 16:17:04 2012 +0100 @@ -170,7 +170,7 @@ local IPs = {}; host_session.ip_hosts = IPs; local handle4, handle6; - local has_other = false; + local have_other_result = not(has_ipv4) or not(has_ipv6) or false; if has_ipv4 then handle4 = adns.lookup(function (reply, err) @@ -195,7 +195,7 @@ end end - if has_other then + if have_other_result then if #IPs > 0 then rfc3484_dest(host_session.ip_hosts, sources); for i = 1, #IPs do @@ -213,11 +213,11 @@ end end else - has_other = true; + have_other_result = true; end end, connect_host, "A", "IN"); else - has_other = true; + have_other_result = true; end if has_ipv6 then @@ -231,7 +231,7 @@ end end - if has_other then + if have_other_result then if #IPs > 0 then rfc3484_dest(host_session.ip_hosts, sources); for i = 1, #IPs do @@ -249,13 +249,12 @@ end end else - has_other = true; + have_other_result = true; end end, connect_host, "AAAA", "IN"); else - has_other = true; + have_other_result = true; end - return true; elseif host_session.ip_hosts and #host_session.ip_hosts > host_session.ip_choice then -- Not our first attempt, and we also have IPs left to try s2sout.try_next_ip(host_session);