[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.
master
Florian Schmaus 4 months ago
parent 95ff591c14
commit 0e0c0a4093
  1. 2
      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);

Loading…
Cancel
Save