Hi guys.
I have tested the stream resumption in release version 4.1.0 and this bug is happening. I believe the problem is in method XMPPTCPConnection.isSmResumptionPossible(), in the last if condition:
if (shutdownTimestamp + maxResumptionMillies > current) {
return false;
} else {
return true;
}
The returned values should be in inverse order.
In addition, other bug can be found in the methods which call to XMPPTCPConnection.getMaxSmResumptionTime(). If the client, or the server, have not set any resumption time this method returns the Integer.MAX_VALUE. Until here all is fine, but then in some pieces of code this value returned is incremented, provoking a overflow and getting negative values from this time. You can reproduce this bug setting a listener using XMPPTCPConnection.addStanzaIdAcknowledgedListener(), In this line:
final int removeAfterSeconds = Math.min(getMaxSmResumptionTime() + 60, 12 * 60 * 60);
The variable removeAfterSeconds get a negative value, so the listener is never called.