Comparison

prosodyctl @ 10257:26afb1a6d086 0.11

prosodyctl: Fix traceback on incorrect proxy65_address type
author Matthew Wild <mwild1@gmail.com>
date Wed, 11 Sep 2019 15:03:54 +0100
parent 9991:8cd180dc18a8
child 10270:c2b9ff42db03
child 10432:7b5a3de26f57
comparison
equal deleted inserted replaced
10236:37ddbfea561e 10257:26afb1a6d086
1101 target_hosts:remove("localhost"); 1101 target_hosts:remove("localhost");
1102 end 1102 end
1103 1103
1104 if modules:contains("proxy65") then 1104 if modules:contains("proxy65") then
1105 local proxy65_target = configmanager.get(host, "proxy65_address") or host; 1105 local proxy65_target = configmanager.get(host, "proxy65_address") or host;
1106 local A, AAAA = dns.lookup(idna.to_ascii(proxy65_target), "A"), dns.lookup(idna.to_ascii(proxy65_target), "AAAA"); 1106 if type(proxy65_target) == "string" then
1107 local prob = {}; 1107 local A, AAAA = dns.lookup(idna.to_ascii(proxy65_target), "A"), dns.lookup(idna.to_ascii(proxy65_target), "AAAA");
1108 if not A then 1108 local prob = {};
1109 table.insert(prob, "A"); 1109 if not A then
1110 end 1110 table.insert(prob, "A");
1111 if v6_supported and not AAAA then 1111 end
1112 table.insert(prob, "AAAA"); 1112 if v6_supported and not AAAA then
1113 end 1113 table.insert(prob, "AAAA");
1114 if #prob > 0 then 1114 end
1115 print(" File transfer proxy "..proxy65_target.." has no "..table.concat(prob, "/") 1115 if #prob > 0 then
1116 .." record. Create one or set 'proxy65_address' to the correct host/IP."); 1116 print(" File transfer proxy "..proxy65_target.." has no "..table.concat(prob, "/")
1117 .." record. Create one or set 'proxy65_address' to the correct host/IP.");
1118 end
1119 else
1120 print(" proxy65_address for "..host.." should be set to a string, unable to perform DNS check");
1117 end 1121 end
1118 end 1122 end
1119 1123
1120 for target_host in target_hosts do 1124 for target_host in target_hosts do
1121 local host_ok_v4, host_ok_v6; 1125 local host_ok_v4, host_ok_v6;