Previously, a time overflow could cause the comparison to fail, and cause a
failed sendBuffer. Now, the code compares against the duration rather than
against the specific timepoint. Since signed overflow/underflow is defined,
subtracting to get the duration is okay as long as the duration fits in the
integer type.
Test Steps
Checklist:
[ ] I have tested my changes. No regression in existing tests.
[ ] I have modified and/or added unit-tests to cover the code changes in this Pull Request.
Fix time comparison in sendBuffer after overflow
Description
Fixes https://github.com/FreeRTOS/coreMQTT/issues/286
Previously, a time overflow could cause the comparison to fail, and cause a failed sendBuffer. Now, the code compares against the duration rather than against the specific timepoint. Since signed overflow/underflow is defined, subtracting to get the duration is okay as long as the duration fits in the integer type.
Test Steps
Checklist:
Related Issue
https://github.com/FreeRTOS/coreMQTT/issues/286
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.