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

[patch] CoapUdpServer infinite loop #58

Closed
GoogleCodeExporter opened this issue Apr 5, 2016 · 4 comments
Closed

[patch] CoapUdpServer infinite loop #58

GoogleCodeExporter opened this issue Apr 5, 2016 · 4 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Issue two or more CoAP requests for valid resources before the first 
resource's second half splitphase is run.
2. Have the second request's second half splitphase complete before the first.
3. Issue another CoAP request.

What is the expected output?
Two properly processed CoAP requests.

What do you see instead?
An infinite loop.

What version of the product are you using? On what operating system?
TinyOS-2.x trunk.

Please provide any additional information below.

The queue handling in CoapUdpServerP.nc is broken. While it can happily insert 
and find nodes at any point in the queue, it always removes the head of the 
queue when it takes something off it, regardless of whether that was the 
correct node or not! When requests complete out-of-order, this in very short 
order then leads to a loop at the queue tail, and all attempts at traversing 
the queue to its end result in an infinite loop (e.g. via 
coap_find_transaction()).

Attached is a patch to properly extract the processed node from the queue. This 
functionality is not needed for the general libcoap queues as they're always 
processed in order, so I put the new coap_extract_node() function into 
CoapUdpServerP.nc rather than libcoap's net.c, even though it provides symmetry 
to coap_insert_node() which resides in net.c.

Original issue reported on code.google.com by jmatts...@dius.com.au on 1 Sep 2011 at 4:11

Attachments:

@GoogleCodeExporter
Copy link
Author

Original comment by sdh...@gmail.com on 1 Sep 2011 at 11:13

@GoogleCodeExporter
Copy link
Author

Thomas is working on it.

Original comment by marku...@gmail.com on 16 Sep 2011 at 8:29

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

Original comment by marku...@gmail.com on 16 Sep 2011 at 8:29

  • Changed state: Started

@GoogleCodeExporter
Copy link
Author

Fixed in r5758. Thanks Steve.

Original comment by marku...@gmail.com on 20 Sep 2011 at 3:16

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant