From 6067287d2a8f4dbcc6eeec2f066364a35b51c290 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 7 Jun 2013 17:47:27 +0100 Subject: mod_bosh: Fix global write --- plugins/mod_bosh.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/mod_bosh.lua b/plugins/mod_bosh.lua index 936cb7b5..f2b7f458 100644 --- a/plugins/mod_bosh.lua +++ b/plugins/mod_bosh.lua @@ -292,7 +292,8 @@ function stream_callbacks.streamopened(context, attr) body_attr.hold = tostring(session.bosh_hold); body_attr.authid = sid; body_attr.secure = "true"; - body_attr.ver = '1.6'; from = session.host; + body_attr.ver = '1.6'; + body_attr.from = session.host; body_attr["xmlns:xmpp"] = "urn:xmpp:xbosh"; body_attr["xmpp:version"] = "1.0"; end -- cgit v1.2.3 From e4a0174799ec8a5b6e55331c30233ba74de502db Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 7 Jun 2013 17:47:49 +0100 Subject: mod_bosh: Remove Connection: keep-alive header (conflicts with new net.http.server) --- plugins/mod_bosh.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mod_bosh.lua b/plugins/mod_bosh.lua index f2b7f458..b88cd969 100644 --- a/plugins/mod_bosh.lua +++ b/plugins/mod_bosh.lua @@ -36,7 +36,7 @@ local bosh_max_wait = module:get_option_number("bosh_max_wait", 120); local consider_bosh_secure = module:get_option_boolean("consider_bosh_secure"); -local default_headers = { ["Content-Type"] = "text/xml; charset=utf-8", ["Connection"] = "keep-alive" }; +local default_headers = { ["Content-Type"] = "text/xml; charset=utf-8" }; local cross_domain = module:get_option("cross_domain_bosh", false); if cross_domain then -- cgit v1.2.3 From ef858fb3e443193abcf221b8727bfa75ba83639a Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Thu, 16 May 2013 10:47:22 +0100 Subject: mod_admin_telnet: Add server:memory() command to view details of Prosody's memory usage --- plugins/mod_admin_telnet.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua index 25830f76..b942e9bd 100644 --- a/plugins/mod_admin_telnet.lua +++ b/plugins/mod_admin_telnet.lua @@ -236,6 +236,7 @@ function commands.help(session, data) elseif section == "server" then print [[server:version() - Show the server's version number]] print [[server:uptime() - Show how long the server has been running]] + print [[server:memory() - Show details about the server's memory usage]] print [[server:shutdown(reason) - Shut down the server, with an optional reason to be broadcast to all connections]] elseif section == "port" then print [[port:list() - Lists all network ports prosody currently listens on]] @@ -300,6 +301,26 @@ function def_env.server:shutdown(reason) return true, "Shutdown initiated"; end +local function human(kb) + local unit = "K"; + if kb > 1024 then + kb, unit = kb/1024, "M"; + end + return ("%0.2f%sB"):format(kb, unit); +end + +function def_env.server:memory() + if not pposix.meminfo then + return true, "Lua is using "..collectgarbage("count"); + end + local mem, lua_mem = pposix.meminfo(), collectgarbage("count"); + local print = self.session.print; + print("Process: "..human((mem.allocated+mem.allocated_mmap)/1024)); + print(" Used: "..human(mem.used/1024).." ("..human(lua_mem).." by Lua)"); + print(" Free: "..human(mem.unused/1024).." ("..human(mem.returnable/1024).." returnable)"); + return true, "OK"; +end + def_env.module = {}; local function get_hosts_set(hosts, module) -- cgit v1.2.3 From b4884d7aabd7a4a13cb02bea60c49ea2208a084b Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Tue, 11 Jun 2013 21:44:53 +0100 Subject: certmanager: Use 'curve' and 'dhparam' options from ssl config if present --- core/certmanager.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/certmanager.lua b/core/certmanager.lua index 49f445f6..f9a54cb1 100644 --- a/core/certmanager.lua +++ b/core/certmanager.lua @@ -62,6 +62,8 @@ function create_context(host, mode, user_ssl_config) verifyext = user_ssl_config.verifyext or default_verifyext; options = user_ssl_config.options or default_options; depth = user_ssl_config.depth; + curve = user_ssl_config.curve; + dhparam = user_ssl_config.dhparam; }; local ctx, err = ssl_newcontext(ssl_config); -- cgit v1.2.3