diff options
author | Kim Alvefur <zash@zash.se> | 2020-06-01 17:27:50 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2020-06-01 17:27:50 +0200 |
commit | ac8a1c76f416d474451807a9231c9bdd9d95e2e8 (patch) | |
tree | 46075778fb2984a6717f716e42613b98772703db /plugins | |
parent | 7eadd412eb46fd12eb2fcc81064f205c49beca83 (diff) | |
download | prosody-ac8a1c76f416d474451807a9231c9bdd9d95e2e8.tar.gz prosody-ac8a1c76f416d474451807a9231c9bdd9d95e2e8.zip |
mod_admin_socket: Use wrapserver if available
Why have a custom accept function when this is net.server's entire
thing?
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_admin_socket.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/mod_admin_socket.lua b/plugins/mod_admin_socket.lua index c094aad2..2085c5b0 100644 --- a/plugins/mod_admin_socket.lua +++ b/plugins/mod_admin_socket.lua @@ -55,7 +55,11 @@ function module.load() os.remove(socket_path); assert(sock:bind(socket_path)); assert(sock:listen()); - conn = server.watchfd(sock:getfd(), accept_connection); + if server.wrapserver then + conn = server.wrapserver(sock, socket_path, 0, listeners); + else + conn = server.watchfd(sock:getfd(), accept_connection); + end end function module.unload() |