From 5394f55419896520bd65088e5e71078006478e9c Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Fri, 7 May 2010 16:00:33 +0500 Subject: prosody: Lowered log level for a log message. --- prosody | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prosody b/prosody index c7f91456..0232b83b 100755 --- a/prosody +++ b/prosody @@ -331,7 +331,7 @@ function init_data_store() end function prepare_to_start() - log("info", "Prosody is using the %s backend for connection handling", server.get_backend()); + log("debug", "Prosody is using the %s backend for connection handling", server.get_backend()); -- Signal to modules that we are ready to start eventmanager.fire_event("server-starting"); prosody.events.fire_event("server-starting"); -- cgit v1.2.3 From 43658f9669a5a3566bdf12e81b3793fdecacf4eb Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Fri, 7 May 2010 16:02:29 +0500 Subject: prosody: Modified function metatable for better string representation of functions. --- prosody | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/prosody b/prosody index 0232b83b..e4e82105 100755 --- a/prosody +++ b/prosody @@ -143,6 +143,10 @@ function set_function_metatable() debug.setupvalue(f, i, value); end end + function mt.__tostring(f) + local info = debug.getinfo(f); + return ("function(%s:%d)"):format(info.short_src:match("[^\\/]*$"), info.linedefined); + end debug.setmetatable(function() end, mt); end -- cgit v1.2.3 From 4e7390dbf9737743951100238a77edcf3f22f1e1 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Fri, 7 May 2010 16:04:45 +0500 Subject: mod_posix: Fixed a global access. --- plugins/mod_posix.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/mod_posix.lua b/plugins/mod_posix.lua index a5fd51ef..9155289d 100644 --- a/plugins/mod_posix.lua +++ b/plugins/mod_posix.lua @@ -79,6 +79,7 @@ local function write_pidfile() end pidfile = module:get_option("pidfile"); if pidfile then + local err; local mode = stat(pidfile) and "r+" or "w+"; pidfile_handle, err = io.open(pidfile, mode); if not pidfile_handle then -- cgit v1.2.3 From c43b31011fc3d488b33945f64c0362666ca96913 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Fri, 7 May 2010 16:10:04 +0500 Subject: mod_console: Set a chunk name for loadstring calls (nicer errors). --- plugins/mod_console.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/mod_console.lua b/plugins/mod_console.lua index ab1d3453..a33302d9 100644 --- a/plugins/mod_console.lua +++ b/plugins/mod_console.lua @@ -84,9 +84,10 @@ function console_listener.listener(conn, data) session.env._ = data; - local chunk, err = loadstring("return "..data); + local chunkname = "=console"; + local chunk, err = loadstring("return "..data, chunkname); if not chunk then - chunk, err = loadstring(data); + chunk, err = loadstring(data, chunkname); if not chunk then err = err:gsub("^%[string .-%]:%d+: ", ""); err = err:gsub("^:%d+: ", ""); -- cgit v1.2.3 From 5459f25151b4de3d3d51120dbf2a6ee8ebabb088 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Fri, 7 May 2010 16:13:05 +0500 Subject: mod_console: Ensure that a null byte is printed after sending the banner. --- plugins/mod_console.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/mod_console.lua b/plugins/mod_console.lua index 4457a2f3..4180e2b6 100644 --- a/plugins/mod_console.lua +++ b/plugins/mod_console.lua @@ -58,6 +58,7 @@ function console_listener.onconnect(conn) local session = console:new_session(conn); sessions[conn] = session; printbanner(session); + session.send(string.char(0)); end function console_listener.onincoming(conn, data) -- cgit v1.2.3