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
1 changed files with 4 additions and 2 deletions

View File

@ -1693,8 +1693,10 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
// See if resumption time is over
long current = System.currentTimeMillis();
long maxResumptionMillies = getMaxSmResumptionTime() * 1000;
if (shutdownTimestamp + maxResumptionMillies > current) {
long maxResumptionMillies = ((long) getMaxSmResumptionTime()) * 1000;
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;
} else {
return true;