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

sys/net/nanocoap: flush stale responses before sending request #21122

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

benpicco
Copy link
Contributor

@benpicco benpicco commented Jan 6, 2025

Contribution description

The nanocoap_sock_request_cb() function performs one CoAP request. Since it re-uses the socket between requests, stale responses can accumulate (especially in the non-confirmable case).

Those are of no use - clear them out before sending a request so they don't fill up the sock's rx queue.

Testing procedure

Issues/PRs references

@github-actions github-actions bot added Area: network Area: Networking Area: CoAP Area: Constrained Application Protocol implementations Area: sys Area: System labels Jan 6, 2025
@benpicco benpicco force-pushed the nanocoap_sock/flush branch from b2ac6a3 to 5869554 Compare January 6, 2025 09:40
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jan 6, 2025
@benpicco benpicco requested review from chrysn and maribu January 6, 2025 10:58
@riot-ci
Copy link

riot-ci commented Jan 6, 2025

Murdock results

✔️ PASSED

5869554 sys/net/nanocoap: flush stale responses before sending request

Success Failures Total Runtime
10248 0 10249 18m:26s

Artifacts

@maribu maribu enabled auto-merge January 6, 2025 11:51
@maribu maribu added this pull request to the merge queue Jan 6, 2025
Merged via the queue into RIOT-OS:master with commit ff92ec9 Jan 6, 2025
27 checks passed
@benpicco benpicco deleted the nanocoap_sock/flush branch January 6, 2025 15:33
@MrKevinWeiss MrKevinWeiss added this to the Release 2025.01 milestone Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: CoAP Area: Constrained Application Protocol implementations Area: network Area: Networking Area: sys Area: System CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants