changeset 3456:b85622b577ad

mod_cache_c2s_caps: Unset the caps_cache also on errors due to the result validation.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Tue, 22 Jan 2019 15:39:35 +0100
parents 1ef702d30b6b
children 058844edcaaf
files mod_cache_c2s_caps/mod_cache_c2s_caps.lua
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_cache_c2s_caps/mod_cache_c2s_caps.lua	Tue Jan 22 15:38:52 2019 +0100
+++ b/mod_cache_c2s_caps/mod_cache_c2s_caps.lua	Tue Jan 22 15:39:35 2019 +0100
@@ -14,6 +14,7 @@
 	local query = stanza:get_child("query", "http://jabber.org/protocol/disco#info");
 	if not query then
 		origin.log("debug", "Wrong iq payload in disco#info result: %s", stanza);
+		origin.caps_cache = nil;
 		return;
 	end
 
@@ -29,6 +30,7 @@
 
 	if node_string ~= node_query then
 		origin.log("debug", "Wrong node for our disco#info query, expected %s, received %s", node_string, node_query);
+		origin.caps_cache = nil;
 		return;
 	end
 
@@ -36,6 +38,7 @@
 	local hash = calculate_hash(query)
 	if ver ~= hash then
 		origin.log("debug", "Wrong hash for disco#info: %s ~= %s", ver, hash);
+		origin.caps_cache = nil;
 		return;
 	end