Software /
code /
prosody
Comparison
plugins/mod_smacks.lua @ 12739:0dc80024fdd2
Backed out changeset 1bc2220cd6ec
The use of the error helpers creates an `<error/>` child element
containing the error condition. This is however not allowed as per
XEP-0198, which specifies that the error condition is to be a direct
child of the `<failed/>` stream management element.
This has triggered a fun reconnect loop in aioxmpp where it was
reported by a user [1].
[1]: https://github.com/horazont/aioxmpp/issues/382
author | Jonas Schäfer <jonas@wielicki.name> |
---|---|
date | Mon, 03 Oct 2022 12:55:11 +0200 |
parent | 12720:0a137436490f |
child | 12745:2cbf0e9314ff |
comparison
equal
deleted
inserted
replaced
12738:62100f31eb8a | 12739:0dc80024fdd2 |
---|---|
55 local watchdog = require "util.watchdog"; | 55 local watchdog = require "util.watchdog"; |
56 local it = require"util.iterators"; | 56 local it = require"util.iterators"; |
57 | 57 |
58 local sessionmanager = require "core.sessionmanager"; | 58 local sessionmanager = require "core.sessionmanager"; |
59 | 59 |
60 local xmlns_errors = "urn:ietf:params:xml:ns:xmpp-stanzas"; | |
60 local xmlns_delay = "urn:xmpp:delay"; | 61 local xmlns_delay = "urn:xmpp:delay"; |
61 local xmlns_mam2 = "urn:xmpp:mam:2"; | 62 local xmlns_mam2 = "urn:xmpp:mam:2"; |
62 local xmlns_sm2 = "urn:xmpp:sm:2"; | 63 local xmlns_sm2 = "urn:xmpp:sm:2"; |
63 local xmlns_sm3 = "urn:xmpp:sm:3"; | 64 local xmlns_sm3 = "urn:xmpp:sm:3"; |
64 | 65 |
645 | 646 |
646 function handle_resume(session, stanza, xmlns_sm) | 647 function handle_resume(session, stanza, xmlns_sm) |
647 local resumed, err = do_resume(session, stanza); | 648 local resumed, err = do_resume(session, stanza); |
648 if not resumed then | 649 if not resumed then |
649 session.send(st.stanza("failed", { xmlns = xmlns_sm, h = format_h(err.context.h) }) | 650 session.send(st.stanza("failed", { xmlns = xmlns_sm, h = format_h(err.context.h) }) |
650 :add_error(err)); | 651 :tag(err.condition, { xmlns = xmlns_errors })); |
651 return true; | 652 return true; |
652 end | 653 end |
653 | 654 |
654 session = resumed.session; | 655 session = resumed.session; |
655 | 656 |