From 75bfec7731e0d42ad5733a62b9772db9c72aeef9 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 30 Jul 2019 02:35:17 +0200 Subject: net.*: Remove tostring call from logging Taken care of by loggingmanager now --- net/connect.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'net/connect.lua') diff --git a/net/connect.lua b/net/connect.lua index b812ffcd..d4de6fb4 100644 --- a/net/connect.lua +++ b/net/connect.lua @@ -38,7 +38,7 @@ local function attempt_connection(p) p:log("debug", "Next target to try is %s:%d", ip, port); local conn, err = server.addclient(ip, port, pending_connection_listeners, p.options.pattern or "*a", p.options.sslctx, conn_type, extra); if not conn then - log("debug", "Connection attempt failed immediately: %s", tostring(err)); + log("debug", "Connection attempt failed immediately: %s", err); p.last_error = err or "unknown reason"; return attempt_connection(p); end -- cgit v1.2.3 From e8f099babcb585312a64d604e4c79f003c3b562b Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 26 Nov 2019 00:12:51 +0100 Subject: net.connect: Add some TODO comments --- net/connect.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'net/connect.lua') diff --git a/net/connect.lua b/net/connect.lua index d4de6fb4..0e11bd3e 100644 --- a/net/connect.lua +++ b/net/connect.lua @@ -2,6 +2,10 @@ local server = require "net.server"; local log = require "util.logger".init("net.connect"); local new_id = require "util.id".short; +-- TODO Respect use_ipv4, use_ipv6 +-- FIXME Error propagation from resolvers doesn't work +-- TODO Try to share DNS resolver object and close it afterwards + local pending_connection_methods = {}; local pending_connection_mt = { __name = "pending_connection"; -- cgit v1.2.3 From 40ffc88bad91782bf8564994826b528609004751 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 7 Dec 2019 17:05:00 +0100 Subject: net.connect: Add some TODOs and FIXMEs And mention issue numbers: #1246, #1428 and #1429 --- net/connect.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'net/connect.lua') diff --git a/net/connect.lua b/net/connect.lua index 0e11bd3e..fe70ce36 100644 --- a/net/connect.lua +++ b/net/connect.lua @@ -3,8 +3,10 @@ local log = require "util.logger".init("net.connect"); local new_id = require "util.id".short; -- TODO Respect use_ipv4, use_ipv6 +-- TODO #1246 Happy Eyeballs -- FIXME Error propagation from resolvers doesn't work --- TODO Try to share DNS resolver object and close it afterwards +-- FIXME #1428 Reuse DNS resolver object between service and basic resolver +-- FIXME #1429 Close DNS resolver object when done local pending_connection_methods = {}; local pending_connection_mt = { -- cgit v1.2.3 From 9d5c3cb856ad15611be84d5324caa8413175f4fe Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 7 Dec 2019 17:39:29 +0100 Subject: net.connect: Mention RFC 6724 regression Default Address Selection algorithm is not applied, resulting in a strong bias towards IPv4. --- net/connect.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'net/connect.lua') diff --git a/net/connect.lua b/net/connect.lua index fe70ce36..6d399dda 100644 --- a/net/connect.lua +++ b/net/connect.lua @@ -4,6 +4,7 @@ local new_id = require "util.id".short; -- TODO Respect use_ipv4, use_ipv6 -- TODO #1246 Happy Eyeballs +-- FIXME RFC 6724 -- FIXME Error propagation from resolvers doesn't work -- FIXME #1428 Reuse DNS resolver object between service and basic resolver -- FIXME #1429 Close DNS resolver object when done -- cgit v1.2.3 From d3a6636c1c070199a5d70a8db4959a78b8d85f1e Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 24 Jan 2020 13:48:49 +0000 Subject: net.connect: Add API to create custom connect()s with options, incl. use_ipv[46] --- net/connect.lua | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) (limited to 'net/connect.lua') diff --git a/net/connect.lua b/net/connect.lua index 6d399dda..2d929087 100644 --- a/net/connect.lua +++ b/net/connect.lua @@ -2,13 +2,17 @@ local server = require "net.server"; local log = require "util.logger".init("net.connect"); local new_id = require "util.id".short; --- TODO Respect use_ipv4, use_ipv6 -- TODO #1246 Happy Eyeballs -- FIXME RFC 6724 -- FIXME Error propagation from resolvers doesn't work -- FIXME #1428 Reuse DNS resolver object between service and basic resolver -- FIXME #1429 Close DNS resolver object when done +local default_connector_options = { + use_ipv4 = true; + use_ipv6 = true; +}; + local pending_connection_methods = {}; local pending_connection_mt = { __name = "pending_connection"; @@ -78,19 +82,24 @@ function pending_connection_listeners.ondisconnect(conn, reason) attempt_connection(p); end -local function connect(target_resolver, listeners, options, data) - local p = setmetatable({ - id = new_id(); - target_resolver = target_resolver; - listeners = assert(listeners); - options = options or {}; - data = data; - }, pending_connection_mt); +local function new_connector(connector_options) + local function connect(target_resolver, listeners, options, data) + local p = setmetatable({ + id = new_id(); + target_resolver = target_resolver; + listeners = assert(listeners); + options = options or {}; + data = data; + connector_options = connector_options or default_connector_options; + }, pending_connection_mt); - p:log("debug", "Starting connection process"); - attempt_connection(p); + p:log("debug", "Starting connection process"); + attempt_connection(p); + end + return connect; end return { - connect = connect; + connect = new_connector(default_connector_options); + new_connector = new_connector; }; -- cgit v1.2.3 From c5fcad823ae67e81cb2b9b674d70fb6290117218 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Sat, 25 Jan 2020 14:25:29 +0000 Subject: Backed out changeset 44ef46e1a951 (not optimal API) --- net/connect.lua | 33 ++++++++++++--------------------- 1 file changed, 12 insertions(+), 21 deletions(-) (limited to 'net/connect.lua') diff --git a/net/connect.lua b/net/connect.lua index 2d929087..6d399dda 100644 --- a/net/connect.lua +++ b/net/connect.lua @@ -2,17 +2,13 @@ local server = require "net.server"; local log = require "util.logger".init("net.connect"); local new_id = require "util.id".short; +-- TODO Respect use_ipv4, use_ipv6 -- TODO #1246 Happy Eyeballs -- FIXME RFC 6724 -- FIXME Error propagation from resolvers doesn't work -- FIXME #1428 Reuse DNS resolver object between service and basic resolver -- FIXME #1429 Close DNS resolver object when done -local default_connector_options = { - use_ipv4 = true; - use_ipv6 = true; -}; - local pending_connection_methods = {}; local pending_connection_mt = { __name = "pending_connection"; @@ -82,24 +78,19 @@ function pending_connection_listeners.ondisconnect(conn, reason) attempt_connection(p); end -local function new_connector(connector_options) - local function connect(target_resolver, listeners, options, data) - local p = setmetatable({ - id = new_id(); - target_resolver = target_resolver; - listeners = assert(listeners); - options = options or {}; - data = data; - connector_options = connector_options or default_connector_options; - }, pending_connection_mt); +local function connect(target_resolver, listeners, options, data) + local p = setmetatable({ + id = new_id(); + target_resolver = target_resolver; + listeners = assert(listeners); + options = options or {}; + data = data; + }, pending_connection_mt); - p:log("debug", "Starting connection process"); - attempt_connection(p); - end - return connect; + p:log("debug", "Starting connection process"); + attempt_connection(p); end return { - connect = new_connector(default_connector_options); - new_connector = new_connector; + connect = connect; }; -- cgit v1.2.3 From 7b89ab9b86d3588717c0833a7b9b89c7513a459e Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 22 Jun 2020 01:42:18 +0200 Subject: net.connect: Remove TODO about use_ipv4/6 done in 3bfb20be844c --- net/connect.lua | 1 - 1 file changed, 1 deletion(-) (limited to 'net/connect.lua') diff --git a/net/connect.lua b/net/connect.lua index 6d399dda..d52d3901 100644 --- a/net/connect.lua +++ b/net/connect.lua @@ -2,7 +2,6 @@ local server = require "net.server"; local log = require "util.logger".init("net.connect"); local new_id = require "util.id".short; --- TODO Respect use_ipv4, use_ipv6 -- TODO #1246 Happy Eyeballs -- FIXME RFC 6724 -- FIXME Error propagation from resolvers doesn't work -- cgit v1.2.3