Mercurial > prosody-hg
comparison plugins/mod_proxy65.lua @ 8643:11b6aa30b3e0
mod_proxy65: Fix all warnings from luacheck
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Wed, 21 Mar 2018 22:13:11 +0000 |
| parents | d2556f237bc2 |
| children | 41c959c5c84b |
comparison
equal
deleted
inserted
replaced
| 8642:d2556f237bc2 | 8643:11b6aa30b3e0 |
|---|---|
| 69 module:log("debug", "Invalid SOCKS5 negotiation recieved: '%s'", b64(data)); | 69 module:log("debug", "Invalid SOCKS5 negotiation recieved: '%s'", b64(data)); |
| 70 end | 70 end |
| 71 end | 71 end |
| 72 end | 72 end |
| 73 | 73 |
| 74 function listener.ondisconnect(conn, err) | 74 function listener.ondisconnect(conn) |
| 75 local session = sessions[conn]; | 75 local session = sessions[conn]; |
| 76 if session then | 76 if session then |
| 77 if transfers[session.sha] then | 77 if transfers[session.sha] then |
| 78 local initiator, target = transfers[session.sha].initiator, transfers[session.sha].target; | 78 local initiator, target = transfers[session.sha].initiator, transfers[session.sha].target; |
| 79 if initiator == conn and target ~= nil then | 79 if initiator == conn and target ~= nil then |
| 80 target:close(); | 80 target:close(); |
| 81 elseif target == conn and initiator ~= nil then | 81 elseif target == conn and initiator ~= nil then |
| 82 initiator:close(); | 82 initiator:close(); |
| 83 end | 83 end |
| 84 transfers[session.sha] = nil; | 84 transfers[session.sha] = nil; |
| 85 end | 85 end |
| 86 -- Clean up any session-related stuff here | 86 -- Clean up any session-related stuff here |
| 87 sessions[conn] = nil; | 87 sessions[conn] = nil; |
| 107 | 107 |
| 108 module:hook("iq-get/host/http://jabber.org/protocol/bytestreams:query", function(event) | 108 module:hook("iq-get/host/http://jabber.org/protocol/bytestreams:query", function(event) |
| 109 local origin, stanza = event.origin, event.stanza; | 109 local origin, stanza = event.origin, event.stanza; |
| 110 | 110 |
| 111 -- check ACL | 111 -- check ACL |
| 112 while proxy_acl and #proxy_acl > 0 do -- using 'while' instead of 'if' so we can break out of it | 112 -- using 'while' instead of 'if' so we can break out of it |
| 113 while proxy_acl and #proxy_acl > 0 do --luacheck: ignore 512 | |
| 113 local jid = stanza.attr.from; | 114 local jid = stanza.attr.from; |
| 114 local allow; | 115 local allow; |
| 115 for _, acl in ipairs(proxy_acl) do | 116 for _, acl in ipairs(proxy_acl) do |
| 116 if jid_compare(jid, acl) then allow = true; break; end | 117 if jid_compare(jid, acl) then allow = true; break; end |
| 117 end | 118 end |
