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

CoAP: fix possible concurrency of multiple responses #1519

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

locomuco
Copy link

This PR fixes a concurrecyy problem, when two CoAP responses are arriving at the same time.
In the current version of the code, the yielded thread for a blocking request is polled through a callback.

The error scenario is as below:

  1. CoAP request (1)
  2. CoAP request (2)
  3. CoAP response (1)
  4. coap_blocking_request_callback (1)
  5. CoAP response (2) -> overrides uip buf, where CoAP payload is stored
  6. invoke yielded thread
  7. call CoAP response (1) handler with wrong payload

(in case of block 2 transfers, the block numbers are also affected and were moved to the state structure)

This PR grants, that the CoAP response handler is called immediately after receiving, without waiting for the poll of the yielded process.

@simonduq
Copy link
Member

simonduq commented Sep 6, 2016

@mkovatsc , much appreciated if you could take a look!

alexrayne pushed a commit to alexrayne/contiki that referenced this pull request Jul 9, 2021
…cc13x0-clock-arch

Minor optimize cc26x0-cc13x0 clock arch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants