Comparison

mod_storage_xmlarchive/mod_storage_xmlarchive.lua @ 2514:d47a7e6e9adc

mod_storage_xmlarchive: Raise error instead of warning if there's ever more than one stanza in a chunk (this indicates some kind of corruption)
author Kim Alvefur <zash@zash.se>
date Mon, 20 Feb 2017 01:47:44 +0100
parent 2420:309db11494c2
child 2595:307ddebb72e1
comparison
equal deleted inserted replaced
2513:66a61f48e376 2514:d47a7e6e9adc
81 username = username or "@"; 81 username = username or "@";
82 query = query or empty; 82 query = query or empty;
83 83
84 local result; 84 local result;
85 local function cb(_, stanza) 85 local function cb(_, stanza)
86 if result then 86 assert(not result, "Multiple items in chunk");
87 module:log("warn", "Multiple items in chunk");
88 end
89 result = stanza; 87 result = stanza;
90 end 88 end
91 89
92 local stream_sess = { notopen = true }; 90 local stream_sess = { notopen = true };
93 local stream = new_stream(stream_sess, { handlestanza = cb, stream_ns = "jabber:client", default_ns = "jabber:client" }); 91 local stream = new_stream(stream_sess, { handlestanza = cb, stream_ns = "jabber:client", default_ns = "jabber:client" });