Hi, I wonder what's the base of the logic to close the TCP connection, when the CoAP payload is empty. Aren't all GET request being sent with the empty payload? Recently, there was a fix around this issue, to take care of the signalling case. I wonder if we can remove the code taking care of the connection closure.
Currently, who is in charge of the TCP adapter code? Thanks and best regards, Max Max Kholmyansky Software Architect - SURE Universal Ltd. http://www.sureuniversal.com On Tue, Jun 5, 2018 at 8:11 PM, <[email protected]> wrote: > There currently is a bug in iotivity, where when sending a "cancelobserve" > request via the iotivity cloud, the client disconnects from the cloud. > After some debugging, I found that the "cancelobserve" request does not > have a payload. This causes a disconnect due to the following line: > > https://github.com/iotivity/iotivity/blob/c7dce6b522604e2c6b > 99847c88a00f7da275c08d/resource/csdk/connectivity/ > src/tcp_adapter/catcpadapter.c#L596 > > However, many other messages also do not have payloads. for example, an > "observe" request, which only differs from the "cancelobserve" request by > sending "SUBSCRIBE" instead of "UNSUBSCRIBE". However, and "observe" > request does not cause a disconnect. This seems to be due to a bug in the > calculation of the size of the payload, which wrongly returns a very large > number instead of zero. The bug is in this line: > > https://github.com/iotivity/iotivity/blob/e84167a1095d892fc2 > 5c1904551f254fbc3c948f/resource/csdk/connectivity/ > src/tcp_adapter/catcpserver.c#L1250 > > Following the above, I have two questions I would like to hear your input > about: > 1. Is there a specific reason for an empty payload in a message to cause a > disconnect? Can this check be removed? > > 2. Do you agree that there is a bug in the code that calculates the size > of the payload? > > > > >
