eclipse / paho.golang

Go libraries
Other
330 stars 92 forks source link

SubOptions (NoLocal,RetainAsPublished) always get false. #167

Closed BANice closed 11 months ago

BANice commented 11 months ago

Describe the bug

// it expect equal 0x04 not 0x01    
 s.NoLocal = (b & 1 << 2) == 1

To reproduce make a client and sub topic with (NoLocal,RetainAsPublished) =true. Unpack function will always get false.

Debug output Any debugging output provided by the client code while reproducing the bug (either embedded to link to the output)

Expected behaviour

BANice commented 11 months ago

I will PR it late.

MattBrittan commented 11 months ago

I've found and fixed a few variations of this in the large change I'm working on. For reference the approach I've used is b&(1<<2) != 0.

BANice commented 11 months ago

great. Thanks.

MattBrittan commented 11 months ago

Had not fixed this specific issue yet (that was the approach Ive used for other flags). Reopened this to ensure it's not forgotten.