From 0e0c0a4093eeda85c76aafc9497bd357ec12e26c Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Sat, 30 Apr 2022 15:06:15 +0200 Subject: [PATCH] [tcp] Fix handling in connection exceptions when resuming a stream Smack would previous run into "assert smResumptionFailed != null;" at line 407, since if a connection exception was encountered, waitForConditionOrConnectionException() would return, but we afterards just assumed that either SM resumption was successful or not. --- .../main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 e8de5e131..c7925ce50 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 @@ -395,7 +395,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection { if (isSmResumptionPossible()) { smResumedSyncPoint = SyncPointState.request_sent; sendNonza(new Resume(clientHandledStanzasCount, smSessionId)); - waitForConditionOrConnectionException(() -> smResumedSyncPoint == SyncPointState.successful || smResumptionFailed != null, "resume previous stream"); + waitForConditionOrThrowConnectionException(() -> smResumedSyncPoint == SyncPointState.successful || smResumptionFailed != null, "resume previous stream"); if (smResumedSyncPoint == SyncPointState.successful) { // We successfully resumed the stream, be done here afterSuccessfulLogin(true);