Report illegal Stream Management state

Fixes SMACK-721.
This commit is contained in:
Florian Schmaus 2016-05-22 12:02:12 +02:00
parent f4ce4b6e77
commit b7211d5d67
1 changed files with 3 additions and 0 deletions

View File

@ -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;
}
}