Collect previous counter from failed stream resumption

The server is allowed to keep the counter after the session has expired,
which allows a final ack to know wheter in-transit stanzas were
delivered or not.
This commit is contained in:
Kim Alvefur 2021-12-23 00:08:12 +01:00 committed by fiaxh
parent 9072f15556
commit 839be0e316
1 changed files with 5 additions and 0 deletions

View File

@ -152,6 +152,11 @@ public class Module : XmppStreamNegotiationModule, WriteNodeFunc {
((IoXmppStream)stream).write_obj = this;
} else if (node.name == "failed") {
session_id = null;
string? h_acked = node.get_attribute("h", NS_URI);
if (h_acked != null) {
h_outbound = int.parse(h_acked);
handle_incoming_h(stream, h_outbound);
}
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"));
}