Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delay time exceeds maximum for 1ms if rand() has max value #41

Closed
MartinMelikMerkumians opened this issue Nov 26, 2015 · 1 comment
Closed
Assignees
Labels

Comments

@MartinMelikMerkumians
Copy link
Member

In the DetermineDelayTime function +1 is added to the randomized delay time. This is wrong for two reasons. First the Spec states that the delay time shall be between 0 and the max delay time, and second if the max delay time is the result of the randomization process, the allocated delay time will be 1ms larger than the allowed delay time.

@MartinMelikMerkumians
Copy link
Member Author

In addition the if condition if the delay time has been reached is also off by +1, as it checks against greater or equal than 0, but if the time has reached 0 the delay has already be fulfilled. So the correct condition is greater than 0 for stalling, otherwise send the message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant