aboutsummaryrefslogtreecommitdiffstats
path: root/net/resolvers/service.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-11-02 19:38:12 +0100
committerKim Alvefur <zash@zash.se>2019-11-02 19:38:12 +0100
commit690775a9b4cc8b36c5f46211c713d4638cc99c1c (patch)
tree959d4a49be75f90dbcb5555db7054c7cdcc01905 /net/resolvers/service.lua
parent1a78e0a7ac93b3d0b4251a865eb994bcd3e5eaba (diff)
parent9c2a74d09c9c45d165a4bcf51f4debfac8877e36 (diff)
downloadprosody-690775a9b4cc8b36c5f46211c713d4638cc99c1c.tar.gz
prosody-690775a9b4cc8b36c5f46211c713d4638cc99c1c.zip
Merge 0.11->trunk
Diffstat (limited to 'net/resolvers/service.lua')
-rw-r--r--net/resolvers/service.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/net/resolvers/service.lua b/net/resolvers/service.lua
index 62d269e5..f9a30f91 100644
--- a/net/resolvers/service.lua
+++ b/net/resolvers/service.lua
@@ -1,5 +1,6 @@
local adns = require "net.adns";
local basic = require "net.resolvers.basic";
+local idna_to_ascii = require "util.encodings".idna.to_ascii;
local unpack = table.unpack or unpack; -- luacheck: ignore 113
local methods = {};
@@ -25,6 +26,11 @@ function methods:next(cb)
return;
end
+ if not self.hostname then
+ -- FIXME report IDNA error
+ cb(nil);
+ end
+
local targets = {};
local function ready()
self.targets = targets;
@@ -63,7 +69,7 @@ end
local function new(hostname, service, conn_type, extra)
return setmetatable({
- hostname = hostname;
+ hostname = idna_to_ascii(hostname);
service = service;
conn_type = conn_type or "tcp";
extra = extra;