aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/prosodyctl/check.lua2
-rw-r--r--util/set.lua6
-rw-r--r--util/startup.lua8
-rw-r--r--util/xmppstream.lua8
4 files changed, 21 insertions, 3 deletions
diff --git a/util/prosodyctl/check.lua b/util/prosodyctl/check.lua
index 4822448a..905703d2 100644
--- a/util/prosodyctl/check.lua
+++ b/util/prosodyctl/check.lua
@@ -47,7 +47,7 @@ local function check(arg)
"umask", "prosodyctl_timeout", "use_ipv6", "use_libevent", "network_settings",
"network_backend", "http_default_host",
"statistics_interval", "statistics", "statistics_config",
- "plugin_server", "installer_plugin_path",
+ "plugin_server", "installer_plugin_path", "gc"
});
local config = configmanager.getconfig();
-- Check that we have any global options (caused by putting a host at the top)
diff --git a/util/set.lua b/util/set.lua
index 827a9158..7e600ebd 100644
--- a/util/set.lua
+++ b/util/set.lua
@@ -32,6 +32,11 @@ function set_mt:__freeze()
return a;
end
+local function is_set(o)
+ local mt = getmetatable(o);
+ return mt == set_mt;
+end
+
local function new(list)
local items = setmetatable({}, items_mt);
local set = { _items = items };
@@ -177,6 +182,7 @@ end
return {
new = new;
+ is_set = is_set;
union = union;
difference = difference;
intersection = intersection;
diff --git a/util/startup.lua b/util/startup.lua
index 11225290..52832988 100644
--- a/util/startup.lua
+++ b/util/startup.lua
@@ -14,7 +14,13 @@ local dependencies = require "util.dependencies";
local original_logging_config;
-local default_gc_params = { mode = "incremental", threshold = 105, speed = 250 };
+local default_gc_params = {
+ mode = "incremental";
+ -- Incremental mode defaults
+ threshold = 105, speed = 500;
+ -- Generational mode defaults
+ minor_threshold = 20, major_threshold = 50;
+};
local short_params = { D = "daemonize", F = "no-daemonize" };
local value_params = { config = true };
diff --git a/util/xmppstream.lua b/util/xmppstream.lua
index 2763b000..be113396 100644
--- a/util/xmppstream.lua
+++ b/util/xmppstream.lua
@@ -22,7 +22,7 @@ local lxp_supports_doctype = pcall(lxp.new, { StartDoctypeDecl = false });
local lxp_supports_xmldecl = pcall(lxp.new, { XmlDecl = false });
local lxp_supports_bytecount = not not lxp.new({}).getcurrentbytecount;
-local default_stanza_size_limit = 1024*1024*10; -- 10MB
+local default_stanza_size_limit = 1024*1024*1; -- 1MB
local _ENV = nil;
-- luacheck: std none
@@ -194,6 +194,9 @@ local function new_sax_handlers(session, stream_callbacks, cb_handleprogress)
stanza = t_remove(stack);
end
else
+ if lxp_supports_bytecount then
+ cb_handleprogress(stanza_size);
+ end
if cb_streamclosed then
cb_streamclosed(session);
end
@@ -295,6 +298,9 @@ local function new(session, stream_callbacks, stanza_size_limit)
return ok, err;
end,
set_session = meta.set_session;
+ set_stanza_size_limit = function (_, new_stanza_size_limit)
+ stanza_size_limit = new_stanza_size_limit;
+ end;
};
end