Mercurial > prosody-modules
comparison mod_net_proxy/mod_net_proxy.lua @ 2935:7319fd5dbc89
mod_net_proxy: Fixed luacheck warnings
author | Pascal Mathis <mail@pascalmathis.com> |
---|---|
date | Fri, 16 Mar 2018 21:17:50 +0100 |
parents | e79b9a55aa2e |
children | 33227efa2cdc |
comparison
equal
deleted
inserted
replaced
2934:5c60df8b1a07 | 2935:7319fd5dbc89 |
---|---|
21 elseif input:len() == 16 then | 21 elseif input:len() == 16 then |
22 local octets = { nil, nil, nil, nil, nil, nil, nil, nil }; | 22 local octets = { nil, nil, nil, nil, nil, nil, nil, nil }; |
23 | 23 |
24 -- Convert received bytes into IPv6 address and skip leading zeroes for each group | 24 -- Convert received bytes into IPv6 address and skip leading zeroes for each group |
25 for index = 1, 8 do | 25 for index = 1, 8 do |
26 high, low = input:byte(index * 2 - 1, index * 2); | 26 local high, low = input:byte(index * 2 - 1, index * 2); |
27 octets[index] = string.format("%x", high * 256 + low); | 27 octets[index] = string.format("%x", high * 256 + low); |
28 end | 28 end |
29 local address = table.concat(octets, ":", 1, 8); | 29 local address = table.concat(octets, ":", 1, 8); |
30 | 30 |
31 -- Search for the longest sequence of zeroes | 31 -- Search for the longest sequence of zeroes |