Software /
code /
prosody-modules
Diff
mod_statistics/prosodytop.lua @ 1343:7dbde05b48a9
all the things: Remove trailing whitespace
author | Florian Zeitz <florob@babelmonkeys.de> |
---|---|
date | Tue, 11 Mar 2014 18:44:01 +0100 |
parent | 1085:56fc7a86eb20 |
child | 1585:64f55bcab9f7 |
line wrap: on
line diff
--- a/mod_statistics/prosodytop.lua Mon Mar 10 08:22:58 2014 +0000 +++ b/mod_statistics/prosodytop.lua Tue Mar 11 18:44:01 2014 +0100 @@ -14,7 +14,7 @@ prosody = { up_since = os.time() }; conn_list = {}; }); - + timer.add_task(0.01, function () local ch = stdscr:getch(); if ch then @@ -26,19 +26,19 @@ end return 0.2; end); - + timer.add_task(0, function () view:draw(); return 1; end); - + --[[ posix.signal(28, function () table.insert(view.conn_list, { jid = "WINCH" }); --view:draw(); end); ]] - + -- Fake socket object around stdin local stdin = { getfd = function () return 0; end; @@ -65,7 +65,7 @@ stdin = server.wrapclient(stdin, "stdin", 0, { onincoming = on_incoming, ondisconnect = function () end }, "*a"); - + local function handle_line(line) local e = { STAT = function (name) return function (value) @@ -79,13 +79,13 @@ setfenv(chunk, e); chunk(); end - + local stats_listener = {}; - + function stats_listener.onconnect(conn) --stdscr:mvaddstr(6, 0, "CONNECTED"); end - + local partial; function stats_listener.onincoming(conn, data) --print("DATA", data) @@ -107,11 +107,11 @@ partial = data:sub(lastpos); end end - + function stats_listener.ondisconnect(conn, err) stdscr:mvaddstr(6, 0, "DISCONNECTED: "..(err or "unknown")); end - + local conn = require "socket".tcp(); assert(conn:connect("localhost", 5782)); handler = server.wrapclient(conn, "localhost", 5279, stats_listener, "*a");