timeout *= 1 << timeouts;
}
+ enum kr_transport_protocol protocol;
+ if (choices[choice].address_state->tls_capable) {
+ protocol = KR_TRANSPORT_TLS;
+ } else if (tcp) {
+ protocol = KR_TRANSPORT_TCP;
+ } else {
+ protocol = KR_TRANSPORT_UDP;
+ }
+
*transport = (struct kr_transport) {
.name = choices[choice].address_state->name,
- .protocol = tcp ? KR_TRANSPORT_TCP : KR_TRANSPORT_UDP,
+ .protocol = protocol,
.timeout = timeout,
};
function policy.TLS_FORWARD(targets)
if type(targets) ~= 'table' or #targets < 1 then
error('TLS_FORWARD argument must be a non-empty table')
- elseif #targets > 4 then
- error('TLS_FORWARD supports at most four targets (in a single call)')
end
local sockaddr_c_set = {}
qry.flags.AWAIT_CUT = true
req.options.TCP = true
qry.flags.TCP = true
- set_nslist(qry, nslist)
+ set_nslist(req, nslist)
return state
end
end