aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_net_multiplex.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-10-10 21:56:47 +0200
committerKim Alvefur <zash@zash.se>2018-10-10 21:56:47 +0200
commit044da0478a9900467ac65e99d0177ea5b68556b6 (patch)
treef2f138ed9d949d0246e08e741b2f2904d926867a /plugins/mod_net_multiplex.lua
parent9c1bbd8313a45f21ad462a47995fdec05aed9b1f (diff)
downloadprosody-044da0478a9900467ac65e99d0177ea5b68556b6.tar.gz
prosody-044da0478a9900467ac65e99d0177ea5b68556b6.zip
mod_net_multiplex: Silence luacheck warnings
Diffstat (limited to 'plugins/mod_net_multiplex.lua')
-rw-r--r--plugins/mod_net_multiplex.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/mod_net_multiplex.lua b/plugins/mod_net_multiplex.lua
index 6db49391..8ef77883 100644
--- a/plugins/mod_net_multiplex.lua
+++ b/plugins/mod_net_multiplex.lua
@@ -18,7 +18,7 @@ end
module:hook("service-added", function (event) add_service(event.service); end);
module:hook("service-removed", function (event) available_services[event.service] = nil; end);
-for service_name, services in pairs(portmanager.get_registered_services()) do
+for _, services in pairs(portmanager.get_registered_services()) do
for _, service in ipairs(services) do
add_service(service);
end
@@ -38,11 +38,11 @@ function listener.onincoming(conn, data)
for service, multiplex_pattern in pairs(available_services) do
if buf:match(multiplex_pattern) then
module:log("debug", "Routing incoming connection to %s", service.name);
- local listener = service.listener;
- conn:setlistener(listener);
- local onconnect = listener.onconnect;
+ local next_listener = service.listener;
+ conn:setlistener(next_listener);
+ local onconnect = next_listener.onconnect;
if onconnect then onconnect(conn) end
- return listener.onincoming(conn, buf);
+ return next_listener.onincoming(conn, buf);
end
end
if #buf > max_buffer_len then -- Give up
@@ -52,7 +52,7 @@ function listener.onincoming(conn, data)
end
end
-function listener.ondisconnect(conn, err)
+function listener.ondisconnect(conn)
buffers[conn] = nil; -- warn if no buffer?
end