go-coap
go-coap copied to clipboard
Fix for messages coming from the message pool always ends up as non-confirmable
Hello!
While using this lib I discovered that observe requests sometimes wasn't retried properly (here). After a bit of digging I found out that messages coming from the message pool always are set to non-confirmable while new messages not coming from the pool are confirmable by default.
Since the blockwise code copies messages it can end up sending a non-confirmable message when the original message was actually set as confirmable.
I am not very familiar with this code base so I am not sure this fix is good, I have tested it with our server and it seems to solve the issue.
To me it feels wrong to assume what the type should be, so I guess it needs to be set every time a message is acquired? Regardless if it is reused or new? I haven't checked the reset of the code base to see if there are more places like this, just this file. In the meantime I use a message pool with 0 max size as a workaround since most messages should be conformable anyway, but that could cause other issues I suppose, I mean I assume that reset sets a message to non-confirmable for a reason.
Cheers and thanks for a good library!
(Seems OK to me, but I'll wait for Jozef to go over it. He's enjoying his holiday this week, so that'll have to wait for next week.)
Thanks @jkralik! Is on a vacation trip at the moment, will take this up again when I am back home.
@andersroos Pls could you resolve linter issue - https://github.com/plgd-dev/go-coap/actions/runs/3014872294 ? After that I will merge PR.
@andersroos Pls could you resolve linter issue - https://github.com/plgd-dev/go-coap/actions/runs/3014872294 ? After that I will merge PR.
Sure! Done.
Great. Thx for contributing !