-
Notifications
You must be signed in to change notification settings - Fork 2k
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
nanocoap sock: stop retransmissions after empty ACK #20697
nanocoap sock: stop retransmissions after empty ACK #20697
Conversation
need to think if the state handling is done correct here. |
If the separate response is pending for a different request. RIOT/examples/nanocoap_server/coap_handler.c Lines 207 to 210 in bf3392b
Can I fix it right here in this PR? |
Sure! |
b173aec
to
9090984
Compare
9090984
to
9dfdf2b
Compare
Given that the request contains a no response option to suppresses certain response classes, this must be communicated to the function somehow. Even if there is no callback, maybe the program must wait for a response. I think before the assumption was, if the no-response option is included, the caller does not provide a callback. |
When you send a request in which you suppress 2.xx replies you still have to wait to maybe get a 4.xx or 5.xx reply. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you suggest we should differentiate between
- ACK received but no separate response (because it was suppressed or lost)
- no ACK received
But I think this is a separate issue.
Thanks for approval. Luckily we only add a no-response option for NON without buffer to write the response to. This case is still catched.
That I did not event think of. But yes, if there is a timeout it could be due to no ACK or no response, which means different things.
Yes |
Contribution description
The
nanocoap_sock_request_cb()
function does a synchronous CoAP request.This PR fixes that further retransmissions are done, even though a matching empty ACK was received.
The behavior is mandatory for CoAP and should also be done when no response callback is set, because the ACK is not the actual response.
Testing procedure
Run
examples/nanocoap_server
andtests/net/nanocoap_cli
and increase the timeout for the/separate
resource.Without this fix, the client keeps retransmitting even after the empty ACK.
Test when I set the server separate response delay to 10 seconds.
bug: Look atno bug just blockwise transfer</vfs>,</separat
When I disable the ACK on the server side I can see retransmissions in wireshark:
But another bug: The serveice unavailable ACK is treated as the response. :(
Issues/PRs references
first split out of #20696