Skip to content
New issue

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

Cannot send non-confirmable responses over blockwise udp connection #547

Closed
azambranogalbis opened this issue Apr 5, 2024 · 1 comment · Fixed by #548
Closed

Cannot send non-confirmable responses over blockwise udp connection #547

azambranogalbis opened this issue Apr 5, 2024 · 1 comment · Fixed by #548
Assignees
Labels
bug Something isn't working

Comments

@azambranogalbis
Copy link
Contributor

Hi!

I have noticed that whenever the blockwise option is enabled in the server, capability to send non-confirmable responses towards the clients is lost.

The key method is Conn.WriteMessage (https://github.com/plgd-dev/go-coap/blob/master/udp/client/conn.go#L498) which executes different paths of code based on the value of the blockWise option.

While having blockWise disabled gives the developer full control on the form of the response (req object gets directly sent over the wire), enabling blockwise ends-up creating a "cloned" req in the newWriteRequestResponse method of blockwise.go (https://github.com/plgd-dev/go-coap/blob/master/net/blockwise/blockwise.go#L267), which is not copying the Type property (which indicates whether the message is or not confirmable). Final result is that all messages missing this property are confirmable by default (https://github.com/plgd-dev/go-coap/blob/master/udp/client/conn.go#L475).

@jkralik jkralik added the bug Something isn't working label Apr 5, 2024
@jkralik jkralik self-assigned this Apr 5, 2024
@jkralik
Copy link
Member

jkralik commented Apr 5, 2024

Thank you for reporting it. If you have the time, could you please fix it? Your help is greatly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants