1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-22 14:22:05 +01:00

Fix isSmResumptionPossible() returning wrong values

The cases where reversed. Change the condition for better readability.

Also fix int and long handling in the computation of
maxResumptionMillies.

Fixes SMACK-654.
This commit is contained in:
Florian Schmaus 2015-04-06 21:59:45 +02:00
parent 3b6891b0d0
commit dabbb40de6

View file

@ -1693,8 +1693,10 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
// See if resumption time is over // See if resumption time is over
long current = System.currentTimeMillis(); long current = System.currentTimeMillis();
long maxResumptionMillies = getMaxSmResumptionTime() * 1000; long maxResumptionMillies = ((long) getMaxSmResumptionTime()) * 1000;
if (shutdownTimestamp + maxResumptionMillies > current) { if (current > shutdownTimestamp + maxResumptionMillies) {
// Stream resumption is *not* possible if the current timestamp is greater then the greatest timestamp where
// resumption is possible
return false; return false;
} else { } else {
return true; return true;