mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-22 03:52:06 +01:00
Report illegal Stream Management state
Fixes SMACK-721.
This commit is contained in:
parent
f4ce4b6e77
commit
b7211d5d67
1 changed files with 3 additions and 0 deletions
|
@ -47,6 +47,9 @@ public class SMUtils {
|
||||||
* @return the delta
|
* @return the delta
|
||||||
*/
|
*/
|
||||||
public static long calculateDelta(long reportedHandledCount, long lastKnownHandledCount) {
|
public static long calculateDelta(long reportedHandledCount, long lastKnownHandledCount) {
|
||||||
|
if (lastKnownHandledCount > reportedHandledCount) {
|
||||||
|
throw new IllegalStateException("Illegal Stream Management State: Last known handled count (" + lastKnownHandledCount + ") is greater than reported handled count (" + reportedHandledCount + ')');
|
||||||
|
}
|
||||||
return (reportedHandledCount - lastKnownHandledCount) & MASK_32_BIT;
|
return (reportedHandledCount - lastKnownHandledCount) & MASK_32_BIT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue