aboutsummaryrefslogtreecommitdiffstats
path: root/prosody
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-05-03 01:11:21 +0100
committerMatthew Wild <mwild1@gmail.com>2009-05-03 01:11:21 +0100
commit67c94f50f4dfd8d3f3de0e84bafb56d37d5cdd83 (patch)
tree7aac7e2c38a5a98eb1c3d84103800a3a9e09e9d9 /prosody
parent29b41d9efd7e4a84f043b38cfdb51893a4504616 (diff)
parent7be3d9f227ff8083e396497507dbdfe9a6049ca8 (diff)
downloadprosody-67c94f50f4dfd8d3f3de0e84bafb56d37d5cdd83.tar.gz
prosody-67c94f50f4dfd8d3f3de0e84bafb56d37d5cdd83.zip
Merge with 0.4
Diffstat (limited to 'prosody')
-rwxr-xr-xprosody21
1 files changed, 12 insertions, 9 deletions
diff --git a/prosody b/prosody
index 9bff11cc..8e85847f 100755
--- a/prosody
+++ b/prosody
@@ -114,8 +114,17 @@ end);
----------- End of out-of-place code --------------
+-- Global function to initiate prosody shutdown
+function prosody_shutdown(reason)
+ log("info", "Shutting down: %s", reason or "unknown reason");
+ eventmanager.fire_event("server-stopping", { reason = reason });
+ server.setquitting(true);
+end
+
+-- Signal to modules that we are ready to start
eventmanager.fire_event("server-starting");
+-- Load SSL settings from config, and create a ctx table
local global_ssl_ctx = ssl and config.get("*", "core", "ssl");
if global_ssl_ctx then
local default_ssl_ctx = { mode = "server", protocol = "sslv23", capath = "/etc/ssl/certs", verify = "none"; };
@@ -153,13 +162,6 @@ if cl.get("console") then
cl.start("console", { interface = config.get("*", "core", "console_interface") or "127.0.0.1" })
end
--- Global function to initiate prosody shutdown
-function prosody_shutdown(reason)
- log("info", "Shutting down: %s", reason or "unknown reason");
- eventmanager.fire_event("server-stopping", { reason = reason });
- server.setquitting(true);
-end
-
-- Catch global accesses --
local locked_globals_mt = { __index = function (t, k) error("Attempt to read a non-existent global '"..k.."'", 2); end, __newindex = function (t, k, v) error("Attempt to set a global: "..tostring(k).." = "..tostring(v), 2); end }
@@ -202,8 +204,9 @@ eventmanager.fire_event("server-cleanup");
-- need to do some tidying before we go :)
server.setquitting(false);
+log("info", "Shutdown status: Closing all active sessions");
for hostname, host in pairs(hosts) do
- log("info", "Shutdown status: Closing client connections for %s", hostname)
+ log("debug", "Shutdown status: Closing client connections for %s", hostname)
if host.sessions then
for username, user in pairs(host.sessions) do
for resource, session in pairs(user.sessions) do
@@ -213,7 +216,7 @@ for hostname, host in pairs(hosts) do
end
end
- log("info", "Shutdown status: Closing outgoing s2s connections from %s", hostname);
+ log("debug", "Shutdown status: Closing outgoing s2s connections from %s", hostname);
if host.s2sout then
for remotehost, session in pairs(host.s2sout) do
if session.close then