aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/modulemanager.lua2
-rw-r--r--net/dns.lua1
-rw-r--r--plugins/mod_compression.lua2
-rw-r--r--plugins/mod_presence.lua2
-rw-r--r--util/datamanager.lua4
5 files changed, 6 insertions, 5 deletions
diff --git a/core/modulemanager.lua b/core/modulemanager.lua
index 7037fc90..6bc8e285 100644
--- a/core/modulemanager.lua
+++ b/core/modulemanager.lua
@@ -228,7 +228,7 @@ function reload(host, name, ...)
end
function handle_stanza(host, origin, stanza)
- local name, xmlns, origin_type = stanza.name, stanza.attr.xmlns, origin.type;
+ local name, xmlns, origin_type = stanza.name, stanza.attr.xmlns or "jabber:client", origin.type;
if name == "iq" and xmlns == "jabber:client" then
if stanza.attr.type == "get" or stanza.attr.type == "set" then
xmlns = stanza.tags[1].attr.xmlns or "jabber:client";
diff --git a/net/dns.lua b/net/dns.lua
index ccb315de..592471bb 100644
--- a/net/dns.lua
+++ b/net/dns.lua
@@ -17,6 +17,7 @@
require 'socket'
local ztact = require 'util.ztact'
local require = require
+local os = os;
local coroutine, io, math, socket, string, table =
coroutine, io, math, socket, string, table
diff --git a/plugins/mod_compression.lua b/plugins/mod_compression.lua
index 7e53a5e5..f1cae737 100644
--- a/plugins/mod_compression.lua
+++ b/plugins/mod_compression.lua
@@ -35,7 +35,7 @@ module:add_event_hook("stream-features",
);
-- TODO Support compression on S2S level too.
-module:add_handler({"c2s_unauthed", "c2s_authed"}, "compress", xmlns_compression_protocol,
+module:add_handler({"c2s_unauthed", "c2s"}, "compress", xmlns_compression_protocol,
function(session, stanza)
-- fail if we are already compressed
if session.compressed then
diff --git a/plugins/mod_presence.lua b/plugins/mod_presence.lua
index f78a5950..d696612d 100644
--- a/plugins/mod_presence.lua
+++ b/plugins/mod_presence.lua
@@ -29,7 +29,7 @@ function core_route_stanza(origin, stanza)
if stanza.attr.type ~= nil and stanza.attr.type ~= "unavailable" and stanza.attr.type ~= "error" then
local node, host = jid_split(stanza.attr.to);
host = hosts[host];
- if host and host.type == "local" then
+ if node and host and host.type == "local" then
handle_inbound_presence_subscriptions_and_probes(origin, stanza, jid_bare(stanza.attr.from), jid_bare(stanza.attr.to), core_route_stanza);
return;
end
diff --git a/util/datamanager.lua b/util/datamanager.lua
index dcc35bb5..4d07d6cc 100644
--- a/util/datamanager.lua
+++ b/util/datamanager.lua
@@ -137,7 +137,7 @@ function store(username, host, datastore, data)
append(f, data);
f:close();
if next(data) == nil then -- try to delete empty datastore
- log("debug", "Removing empty %s datastore for user %s@%s", datastore, username, host);
+ log("debug", "Removing empty %s datastore for user %s@%s", datastore, username or "nil", host or "nil");
os_remove(getpath(username, host, datastore));
end
-- we write data even when we are deleting because lua doesn't have a
@@ -179,7 +179,7 @@ function list_store(username, host, datastore, data)
end
f:close();
if next(data) == nil then -- try to delete empty datastore
- log("debug", "Removing empty %s datastore for user %s@%s", datastore, username, host);
+ log("debug", "Removing empty %s datastore for user %s@%s", datastore, username or "nil", host or "nil");
os_remove(getpath(username, host, datastore, "list"));
end
-- we write data even when we are deleting because lua doesn't have a