mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-12-22 20:47:57 +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
|
||||
*/
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue