aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-01-16 22:44:43 +0100
committerKim Alvefur <zash@zash.se>2016-01-16 22:44:43 +0100
commit48f8c23f4ab0e8400e20101960055eb29c4aa6f7 (patch)
treebde7b68581a288e5d3fc8a036c80502296972394
parent69f9998d1641846399e3d2818da4fd07ae05739a (diff)
parent83e7c91e0130f27720406b87996c4c74b7cc0afe (diff)
downloadprosody-48f8c23f4ab0e8400e20101960055eb29c4aa6f7.tar.gz
prosody-48f8c23f4ab0e8400e20101960055eb29c4aa6f7.zip
Merge 0.10->trunk
-rw-r--r--core/portmanager.lua2
-rw-r--r--net/http/server.lua2
-rw-r--r--plugins/mod_blocklist.lua2
-rwxr-xr-xprosody9
-rwxr-xr-xprosodyctl18
-rw-r--r--util/random.lua6
6 files changed, 28 insertions, 11 deletions
diff --git a/core/portmanager.lua b/core/portmanager.lua
index ad1a0be3..60f7731d 100644
--- a/core/portmanager.lua
+++ b/core/portmanager.lua
@@ -29,7 +29,7 @@ if socket.tcp6 and config.get("*", "use_ipv6") ~= false then
table.insert(default_local_interfaces, "::1");
end
-local default_mode = config.get("*", "network_default_read_size") or 4096;
+local default_mode = config.get("*", "network_default_read_size") or "*a";
--- Private state
diff --git a/net/http/server.lua b/net/http/server.lua
index 9649d0e8..aeaa7416 100644
--- a/net/http/server.lua
+++ b/net/http/server.lua
@@ -294,7 +294,7 @@ function _M.remove_handler(event, handler)
end
function _M.listen_on(port, interface, ssl)
- addserver(interface or "*", port, listener, "*a", ssl);
+ return addserver(interface or "*", port, listener, "*a", ssl);
end
function _M.add_host(host)
hosts[host] = true;
diff --git a/plugins/mod_blocklist.lua b/plugins/mod_blocklist.lua
index e2ed626b..8efbfd96 100644
--- a/plugins/mod_blocklist.lua
+++ b/plugins/mod_blocklist.lua
@@ -221,7 +221,7 @@ module:hook("iq-set/self/urn:xmpp:blocking:unblock", edit_blocklist);
-- Cache invalidation, solved!
module:hook_global("user-deleted", function (event)
if event.host == module.host then
- cache:set(event.username, nil);
+ cache2:set(event.username, nil);
cache[event.username] = nil;
end
end);
diff --git a/prosody b/prosody
index a2cb0e6c..6a3b50db 100755
--- a/prosody
+++ b/prosody
@@ -272,10 +272,14 @@ function init_global_state()
end
-- Function to initiate prosody shutdown
- function prosody.shutdown(reason)
+ function prosody.shutdown(reason, code)
log("info", "Shutting down: %s", reason or "unknown reason");
prosody.shutdown_reason = reason;
- prosody.events.fire_event("server-stopping", {reason = reason});
+ prosody.shutdown_code = code;
+ prosody.events.fire_event("server-stopping", {
+ reason = reason;
+ code = code;
+ });
server.setquitting(true);
end
end
@@ -418,3 +422,4 @@ cleanup();
prosody.events.fire_event("server-stopped");
log("info", "Shutdown complete");
+os.exit(prosody.shutdown_code)
diff --git a/prosodyctl b/prosodyctl
index 0c80aca7..1a487fb5 100755
--- a/prosodyctl
+++ b/prosodyctl
@@ -877,6 +877,20 @@ function commands.check(arg)
print(" All hosts are disabled. Remove enabled = false from at least one VirtualHost section")
end
end
+ if not config["*"].modules_enabled then
+ print(" No global modules_enabled is set?");
+ local suggested_global_modules;
+ for host, options in enabled_hosts() do
+ if not options.component_module and options.modules_enabled then
+ suggested_global_modules = set.intersection(suggested_global_modules or set.new(options.modules_enabled), set.new(options.modules_enabled));
+ end
+ end
+ if not suggested_global_modules:empty() then
+ print(" Consider moving these modules into modules_enabled in the global section:")
+ print(" "..tostring(suggested_global_modules / function (x) return ("%q"):format(x) end));
+ end
+ print();
+ end
-- Check for global options under hosts
local global_options = set.new(it.to_array(it.keys(config["*"])));
local deprecated_global_options = set.intersection(global_options, deprecated);
@@ -1080,8 +1094,8 @@ function commands.check(arg)
target_hosts:remove("localhost");
end
- local modules = set.new(it.to_array(it.values(host_options.modules_enabled)))
- + set.new(it.to_array(it.values(config.get("*", "modules_enabled"))))
+ local modules = set.new(it.to_array(it.values(host_options.modules_enabled or {})))
+ + set.new(it.to_array(it.values(config.get("*", "modules_enabled") or {})))
+ set.new({ config.get(host, "component_module") });
if modules:contains("proxy65") then
diff --git a/util/random.lua b/util/random.lua
index 4963e98c..05f36aba 100644
--- a/util/random.lua
+++ b/util/random.lua
@@ -6,11 +6,9 @@
-- COPYING file in the source package for more information.
--
-local urandom = assert(io.open("/dev/urandom", "r+"));
+local urandom = assert(io.open("/dev/urandom", "r"));
-local function seed(x)
- urandom:write(x);
- urandom:flush();
+local function seed()
end
local function bytes(n)