From 5cdbe0edde662c434cb5c4df8c5153a1b324a4b0 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 1 Jun 2020 17:27:50 +0200 Subject: mod_admin_socket: Use wrapserver if available Why have a custom accept function when this is net.server's entire thing? --- plugins/mod_admin_socket.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'plugins/mod_admin_socket.lua') 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() -- cgit v1.2.3