Software /
code /
prosody
Comparison
plugins/mod_admin_shell.lua @ 12887:68df46926c26 0.12
mod_admin_socket: Return error on unhandled input to prevent apparent freeze
When mod_admin_socket is loaded without mod_admin_shell, attempt to use
`prosodyctl shell` will appear to freeze after any input, since no
response is returned.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 16 Feb 2023 17:20:09 +0100 |
parent | 12788:3835c397b129 |
child | 12888:b8504b71735d |
child | 13077:de42a93a7c8d |
comparison
equal
deleted
inserted
replaced
12885:3a6dae39c70e | 12887:68df46926c26 |
---|---|
196 module:hook("admin/repl-input", function (event) | 196 module:hook("admin/repl-input", function (event) |
197 local ok, err = pcall(handle_line, event); | 197 local ok, err = pcall(handle_line, event); |
198 if not ok then | 198 if not ok then |
199 event.origin.send(st.stanza("repl-result", { type = "error" }):text(err)); | 199 event.origin.send(st.stanza("repl-result", { type = "error" }):text(err)); |
200 end | 200 end |
201 return true; | |
201 end); | 202 end); |
202 | 203 |
203 -- Console commands -- | 204 -- Console commands -- |
204 -- These are simple commands, not valid standalone in Lua | 205 -- These are simple commands, not valid standalone in Lua |
205 | 206 |