We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Step to reproduce:
https://github.com/mochi-co/mqtt/blob/bb54cc68e67d43e1397286594541d77330b2910b/clients.go#L255-L256 If current value of cl.State.packetID is 65535, then i = 65535, started = 65536. Once it enters the for loop, i is set to 1 and overflowed = true. If inflight contains all 65535 messages, then the only condition it can exit the loop is:
i = 65535
started = 65536
if overflowed && i == started { return 0, packets.ErrQuotaExceeded }
overflowed is true, but i will never reach 65536, i == started condition can never be met.
overflowed
i
i == started
Here is an example in Go Playground, with the following condition removed.
if _, ok := cl.State.Inflight.Get(uint16(i)); !ok { break }
The text was updated successfully, but these errors were encountered:
Resolved in #169. Thanks @mochi-co.
Sorry, something went wrong.
mochi-co
No branches or pull requests
Step to reproduce:
https://github.com/mochi-co/mqtt/blob/bb54cc68e67d43e1397286594541d77330b2910b/clients.go#L255-L256
If current value of cl.State.packetID is 65535, then
i = 65535
,started = 65536
. Once it enters the for loop, i is set to 1 and overflowed = true. If inflight contains all 65535 messages, then the only condition it can exit the loop is:overflowed
is true, buti
will never reach 65536,i == started
condition can never be met.Here is an example in Go Playground, with the following condition removed.
The text was updated successfully, but these errors were encountered: