Software /
code /
prosody
Changeset
10862:1cfae9e85021
mod_admin_socket: Use wrapserver if available
Why have a custom accept function when this is net.server's entire
thing?
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 01 Jun 2020 17:27:50 +0200 |
parents | 10861:e12690a37795 |
children | 10863:455a151db834 |
files | plugins/mod_admin_socket.lua |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_admin_socket.lua Mon Jun 01 17:19:08 2020 +0200 +++ b/plugins/mod_admin_socket.lua Mon Jun 01 17:27:50 2020 +0200 @@ -55,7 +55,11 @@ 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()