Forget previous session on failed stream resumption (#1164)

Assuming received_features_node() is what triggers another attempt to
authenticate, this should prevent an attempt to XEP-0198 resume again
using the same session id.
This commit is contained in:
Kim Alvefur 2021-12-23 00:02:43 +01:00 committed by fiaxh
parent 795af2d9ce
commit 9072f15556

View file

@ -151,13 +151,13 @@ public class Module : XmppStreamNegotiationModule, WriteNodeFunc {
check_queue(stream); check_queue(stream);
((IoXmppStream)stream).write_obj = this; ((IoXmppStream)stream).write_obj = this;
} else if (node.name == "failed") { } else if (node.name == "failed") {
stream.received_features_node(stream);
session_id = null; session_id = null;
foreach (var id in in_flight_stanzas.keys) { foreach (var id in in_flight_stanzas.keys) {
in_flight_stanzas[id].promise.set_exception(new IOStreamError.WRITE("Stanza not acked and session not resumed")); in_flight_stanzas[id].promise.set_exception(new IOStreamError.WRITE("Stanza not acked and session not resumed"));
} }
in_flight_stanzas.clear(); in_flight_stanzas.clear();
check_queue(stream); check_queue(stream);
stream.received_features_node(stream);
} }
} }
} }