Mercurial > prosody-modules
view mod_auth_external/examples/lua/prosody-auth-example.lua @ 3659:bb8a6df5ecba
mod_http_upload: Skip write if nothing expired when checking
Reducing unnecessary IO is good.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Thu, 29 Aug 2019 23:35:42 +0200 |
| parents | b6280e8886f4 |
| children |
line wrap: on
line source
local actions = {}; function actions.auth(data) local user, host, pass = data:match("^([^:]+):([^:]+):(.+)$"); if user == "someone" then return "1"; end end for line in io.lines() do local action, data = line:match("^([^:]+)(.*)$"); print(actions[action] and actions[action](data) or "0"); end
