Software / code / prosody
Comparison
util/rfc6724.lua @ 12975:d10957394a3c
util: Prefix module imports with prosody namespace
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 17 Mar 2023 16:23:16 +0100 |
| parent | 7259:d8300985f2bb |
comparison
equal
deleted
inserted
replaced
| 12974:ba409c67353b | 12975:d10957394a3c |
|---|---|
| 7 | 7 |
| 8 -- This is used to sort destination addresses by preference | 8 -- This is used to sort destination addresses by preference |
| 9 -- during S2S connections. | 9 -- during S2S connections. |
| 10 -- We can't hand this off to getaddrinfo, since it blocks | 10 -- We can't hand this off to getaddrinfo, since it blocks |
| 11 | 11 |
| 12 local ip_commonPrefixLength = require"util.ip".commonPrefixLength | 12 local ip_commonPrefixLength = require"prosody.util.ip".commonPrefixLength |
| 13 | 13 |
| 14 local function commonPrefixLength(ipA, ipB) | 14 local function commonPrefixLength(ipA, ipB) |
| 15 local len = ip_commonPrefixLength(ipA, ipB); | 15 local len = ip_commonPrefixLength(ipA, ipB); |
| 16 return len < 64 and len or 64; | 16 return len < 64 and len or 64; |
| 17 end | 17 end |