From 0191ed7174807848dc1a84ac598fb295147ef25d Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Thu, 17 Oct 2024 18:10:54 +0200 Subject: [PATCH] [tcp] Report SM resumption impossible if not instant shutdown If the connection got not instantanously shut down, then we also dropped all SM state and should not report that SM resumption is possible. This most likely fixes SMACK-954.x --- .../java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java index 146cfbee5..61b144cb8 100644 --- a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java +++ b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java @@ -1798,6 +1798,10 @@ public class XMPPTCPConnection extends AbstractXMPPConnection { if (smSessionId == null) return false; + // If we are not in instant shutdown, i.e., a shutdown which leaves the connection in a resumable state, then SM resumption is not possible. + if (!packetWriter.instantShutdown) + return false; + final Long shutdownTimestamp = packetWriter.shutdownTimestamp; // Seems like we are already reconnected, report true if (shutdownTimestamp == null) {