aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2008-12-07 19:18:50 +0000
committerMatthew Wild <mwild1@gmail.com>2008-12-07 19:18:50 +0000
commitf48883b6ab37867f687aa6279f43da6a56cd40f1 (patch)
treeac0e72316d86c2f578943a42491152bb8276e9c5
parent2e6fcdb2d0126ddf6dac449d950ffbf5c7c523ba (diff)
parentd3e7e2f1a7007f79edd38daf0adcf63e4fe950e3 (diff)
downloadprosody-f48883b6ab37867f687aa6279f43da6a56cd40f1.tar.gz
prosody-f48883b6ab37867f687aa6279f43da6a56cd40f1.zip
Automated merge with http://waqas.ath.cx:8000/
-rw-r--r--core/s2smanager.lua2
-rw-r--r--core/sessionmanager.lua2
-rw-r--r--net/xmppclient_listener.lua5
-rw-r--r--net/xmppserver_listener.lua4
-rw-r--r--plugins/mod_posix.lua4
5 files changed, 5 insertions, 12 deletions
diff --git a/core/s2smanager.lua b/core/s2smanager.lua
index ae834a9c..7827381d 100644
--- a/core/s2smanager.lua
+++ b/core/s2smanager.lua
@@ -43,7 +43,7 @@ local log = logger_init("s2smanager");
local sha256_hash = require "util.hashes".sha256;
-local dialback_secret = "This is very secret!!! Ha!";
+local dialback_secret = sha256_hash(tostring{} .. math.random() .. socket.gettime(), true);
local dns = require "net.dns";
diff --git a/core/sessionmanager.lua b/core/sessionmanager.lua
index a597e724..34cc9f0f 100644
--- a/core/sessionmanager.lua
+++ b/core/sessionmanager.lua
@@ -69,7 +69,7 @@ function destroy_session(session, err)
local pres = st.presence{ type = "unavailable" };
if (not err) or err == "closed" then err = "connection closed"; end
pres:tag("status"):text("Disconnected: "..err);
- session.stanza_dispatch(pres);
+ session:dispatch_stanza(pres);
end
-- Remove session/resource from user's session list
diff --git a/net/xmppclient_listener.lua b/net/xmppclient_listener.lua
index c2326a55..e54445b0 100644
--- a/net/xmppclient_listener.lua
+++ b/net/xmppclient_listener.lua
@@ -126,10 +126,7 @@ function xmppclient.listener(conn, data)
session_reset_stream(session); -- Initialise, ready for use
- -- Debug version --
- --local function handleerr(err) print("Traceback:", err, debug.traceback()); end
- --session.stanza_dispatch = function (stanza) return select(2, xpcall(function () return core_process_stanza(session, stanza); end, handleerr)); end
-
+ session.stanza_dispatch = stream_callbacks.handlestanza;
end
if data then
session.data(conn, data);
diff --git a/net/xmppserver_listener.lua b/net/xmppserver_listener.lua
index e4816b1e..4d2840e7 100644
--- a/net/xmppserver_listener.lua
+++ b/net/xmppserver_listener.lua
@@ -129,9 +129,7 @@ function xmppserver.listener(conn, data)
session_reset_stream(session); -- Initialise, ready for use
- -- Debug version --
--- local function handleerr(err) print("Traceback:", err, debug.traceback()); end
--- session.stanza_dispatch = function (stanza) return select(2, xpcall(function () return core_process_stanza(session, stanza); end, handleerr)); end
+ session.stanza_dispatch = stream_callbacks.handlestanza;
end
if data then
session.data(conn, data);
diff --git a/plugins/mod_posix.lua b/plugins/mod_posix.lua
index 8dc4c77d..7559d3ed 100644
--- a/plugins/mod_posix.lua
+++ b/plugins/mod_posix.lua
@@ -35,15 +35,13 @@ if not config_get("*", "core", "no_daemonize") then
log("info", "Daemonized to pid %d", ret);
os.exit(0);
else
- log("info", "Successfully daemonized");
-
if logwriter then
local ok, ret = logger_set(logwriter);
if not ok then
log("error", "Couldn't set new log output: %s", ret);
end
end
-
+ log("info", "Successfully daemonized");
end
end
module:add_event_hook("server-starting", daemonize_server);