aboutsummaryrefslogtreecommitdiffstats
path: root/prosody
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2009-03-03 17:48:04 +0100
committerTobias Markmann <tm@ayena.de>2009-03-03 17:48:04 +0100
commit7a7a89844a038b071f02fd1af309ba9ebbcda7de (patch)
tree73946c977be10a965d59de85b3ce6ba3743bc771 /prosody
parent3d1e7adbbc0afb8395f02ecd42fe3c38ce6a8d36 (diff)
parentb6b9906c3c653935b55ad79ad4a2c41118f0a0e3 (diff)
downloadprosody-7a7a89844a038b071f02fd1af309ba9ebbcda7de.tar.gz
prosody-7a7a89844a038b071f02fd1af309ba9ebbcda7de.zip
Merged with main tip.
Diffstat (limited to 'prosody')
-rwxr-xr-xprosody28
1 files changed, 24 insertions, 4 deletions
diff --git a/prosody b/prosody
index 197446e6..15c94c92 100755
--- a/prosody
+++ b/prosody
@@ -7,14 +7,14 @@
-- COPYING file in the source package for more information.
--
--- Config here --
+-- Will be modified by configure script if run --
CFG_SOURCEDIR=nil;
CFG_CONFIGDIR=os.getenv("PROSODY_CFGDIR");
CFG_PLUGINDIR=nil;
CFG_DATADIR=os.getenv("PROSODY_DATADIR");
--- -- -- -- -- --
+-- -- -- -- -- -- -- ---- -- -- -- -- -- -- -- --
if CFG_SOURCEDIR then
package.path = CFG_SOURCEDIR.."/?.lua;"..package.path
@@ -84,7 +84,9 @@ require "core.usermanager"
require "core.sessionmanager"
require "core.stanza_router"
---[[
+-- Commented to protect us from
+-- the second kind of people
+--[[
pcall(require, "remdebug.engine");
if remdebug then remdebug.engine.start() end
]]
@@ -104,6 +106,7 @@ require "util.datamanager".set_data_path(data_path);
----------- End of out-of-place code --------------
+
eventmanager.fire_event("server-starting");
@@ -148,4 +151,21 @@ end
eventmanager.fire_event("server-started");
-server.loop();
+local quitting;
+while not quitting do
+ xpcall(server.loop, function (err)
+ if err:match("%d*: interrupted!$") then
+ quitting = true;
+ return;
+ end
+
+ log("error", "Top-level error, please report:\n%s", tostring(err));
+
+ local traceback = debug.traceback("", 2);
+ if traceback then
+ log("error", "%s", traceback);
+ end
+
+ eventmanager.fire_event("very-bad-error", "*", err, traceback);
+ end);
+end