Skip to content

Make sequences wrap around to avoid overflows#438

Merged
sashahilton00 merged 1 commit intolibrespot-org:devfrom
Malvineous:patch-3
Feb 27, 2020
Merged

Make sequences wrap around to avoid overflows#438
sashahilton00 merged 1 commit intolibrespot-org:devfrom
Malvineous:patch-3

Conversation

@Malvineous
Copy link
Copy Markdown
Contributor

@Malvineous Malvineous commented Feb 23, 2020

Instead of aborting with an attempt to add with overflow error, wrap the sequence around so that it goes back to 0 once it has reached the maximum value for the integer type. Fixes #437.

Everything that uses sequences seems to treat them as unique values for matching asynchronous responses back to requests, so having the sequence number wrap at some point long after the original response has been received should cause no problems.

Instead of aborting with an `attempt to add with overflow` error, wrap the sequence around so that it goes back to 0 once it has reached the maximum value for the integer type.  Fixes #437.
@sashahilton00 sashahilton00 merged commit 66f8a98 into librespot-org:dev Feb 27, 2020
paulfariello pushed a commit to paulfariello/librespot that referenced this pull request Sep 23, 2025
Make sequences wrap around to avoid overflows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash after running for some time - sequence overflow

2 participants