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
Session Expiry checking does work only by chance #1525
Comments
Thanks Christoph, that's fixed and a test modified to include your example. |
ralight
added a commit
that referenced
this issue
Dec 12, 2019
Closes #1525. Thanks to Christoph Krey.
Thanks Roger |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
session_expiry.c
uses an ordered list to check periodically for expired sessions.The list is supposed to be ordered by
session_expiry_time
.The
cmp
function used does return an int, but subtracts two UINT32s, which does not givethe expected result if the operands are very different.
Example:
unsigned
4294967295 - 3 = 4294967292
, converted to in int is-4
Reproduce:
mosquitto_sub -t '#' -v -d -i def -c -D connect session-expiry-interval 5
mosquitto_sub -t '#' -v -d -i abc-c -D connect session-expiry-interval 4294967295
mosquitto_sub -t '#' -v -d -i def -c -D connect session-expiry-interval 5
because it
The text was updated successfully, but these errors were encountered: