# HG changeset patch # User Matthew Wild # Date 1594382402 -3600 # Node ID 1d8e1f7a587c625949aa53248b48ca1dc99358f6 # Parent e2ce067bb59a1443a92c32244fa684464a08c49b net.resolvers.basic: Default conn_type to 'tcp' consistently if unspecified (thanks marc0s) Fixes a traceback when passed an IP address with no conn_type. diff -r e2ce067bb59a -r 1d8e1f7a587c net/resolvers/basic.lua --- a/net/resolvers/basic.lua Tue Jul 07 13:52:25 2020 +0100 +++ b/net/resolvers/basic.lua Fri Jul 10 13:00:02 2020 +0100 @@ -58,6 +58,7 @@ local function new(hostname, port, conn_type, extra) local ascii_host = idna_to_ascii(hostname); local targets = nil; + conn_type = conn_type or "tcp"; local is_ip = inet_pton(hostname); if not is_ip and hostname:sub(1,1) == '[' then @@ -75,7 +76,7 @@ return setmetatable({ hostname = ascii_host; port = port; - conn_type = conn_type or "tcp"; + conn_type = conn_type; extra = extra; targets = targets; }, resolver_mt);