Closed azambranogalbis closed 2 months ago
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).
Thank you for reporting it. If you have the time, could you please fix it? Your help is greatly appreciated.
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).