Software /
code /
prosody
Comparison
net/connect.lua @ 12205:a2e6605303fa
net.connect: Allow passing TLS context from resolver
Only allowing it to be passed directly makes it hard to combine plain
(i.e. starttls) and Direct TLS connections in the same connection
resolution procedure. But now we can, using chained resolvers!
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 21 Jan 2022 17:57:47 +0100 |
parent | 11903:baf69f254753 |
child | 12411:e132a4279914 |
comparison
equal
deleted
inserted
replaced
12204:7c397a49d163 | 12205:a2e6605303fa |
---|---|
40 p.listeners.onfail(p.data, p.last_error or p.target_resolver.last_error or "unable to resolve service"); | 40 p.listeners.onfail(p.data, p.last_error or p.target_resolver.last_error or "unable to resolve service"); |
41 end | 41 end |
42 return; | 42 return; |
43 end | 43 end |
44 p:log("debug", "Next target to try is %s:%d", ip, port); | 44 p:log("debug", "Next target to try is %s:%d", ip, port); |
45 local conn, err = server.addclient(ip, port, pending_connection_listeners, p.options.pattern or "*a", p.options.sslctx, conn_type, extra); | 45 local conn, err = server.addclient(ip, port, pending_connection_listeners, p.options.pattern or "*a", |
46 extra and extra.sslctx or p.options.sslctx, conn_type, extra); | |
46 if not conn then | 47 if not conn then |
47 log("debug", "Connection attempt failed immediately: %s", err); | 48 log("debug", "Connection attempt failed immediately: %s", err); |
48 p.last_error = err or "unknown reason"; | 49 p.last_error = err or "unknown reason"; |
49 return attempt_connection(p); | 50 return attempt_connection(p); |
50 end | 51 end |