shamblett / coap

A Coap package for dart
Other
16 stars 13 forks source link

Blockwise transfer during multicast not working properly #55

Closed JKRhb closed 2 years ago

JKRhb commented 2 years ago

If a Client sends a multicast request and receives a response using blockwise transfer, it seems as if the client is currently not switching to a unicast transfer to handle the remaining blocks (c. f. RFC 7959, section 2.8). This causes problems as subsequent blocks will also be requested from the multicast address which leads to an exponential(?) growth of requests and responses (if multiple servers are part of the same group and provide a similar resource) until a final block has been reached while also corrupting the total payload.

I will try to provide a fix for this problem in the upcoming days.

JKRhb commented 2 years ago

Revisiting this issue, I noticed that multicast in general does not seem to work properly at the moment as exchanges are marked as completed once a response is received, for example. This cannot simply be disabled for multicast requests, however, as they are not marked as non-confirmable, which causes servers to respond multiple times to the same request.

I will try to come up with a seperate PR to fix these issues soon once I have figured out where the current implementation needs to be tweaked in order to fully support (simple) multicast requests.