Changeset

3114:75ea1aff69da

mod_private: Detect datamanager read errors, and respond with 'internal-server-error'.
author Waqas Hussain <waqas20@gmail.com>
date Mon, 24 May 2010 01:00:30 +0500
parents 3113:30896751dd43
children 3115:4c35ef27d868
files plugins/mod_private.lua
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_private.lua	Mon May 24 00:49:12 2010 +0500
+++ b/plugins/mod_private.lua	Mon May 24 01:00:30 2010 +0500
@@ -26,7 +26,11 @@
 				if #query.tags == 1 then
 					local tag = query.tags[1];
 					local key = tag.name..":"..tag.attr.xmlns;
-					local data = datamanager.load(node, host, "private");
+					local data, err = datamanager.load(node, host, "private");
+					if err then
+						session.send(st.error_reply(stanza, "wait", "internal-server-error"));
+						return true;
+					end
 					if stanza.attr.type == "get" then
 						if data and data[key] then
 							session.send(st.reply(stanza):tag("query", {xmlns = "jabber:iq:private"}):add_child(st.deserialize(data[key])));