Comments (6)
I may have fixed this issue.
Here is diff:
ubuntu@xxxxx:~/workspace/openSource/openthread$ git diff
diff --git a/src/core/coap/coap.cpp b/src/core/coap/coap.cpp
index 696d0fc83..64e148792 100644
--- a/src/core/coap/coap.cpp
+++ b/src/core/coap/coap.cpp
@@ -655,7 +655,7 @@ Error CoapBase::PrepareNextBlockRequest(Message::BlockType aType,
}
// Copy option
- SuccessOrExit(error = iterator.ReadOptionValue(&optionBuf));
+ SuccessOrExit(error = iterator.ReadOptionValue(optionBuf));
SuccessOrExit(error = aRequest.AppendOption(optionNumber, iterator.GetOption()->GetLength(), &optionBuf));
}
ReadOptionValue accepts a void* or &uint64_t type,and optionBuf is a uint64_t type. Obviously, this is a typo.
from openthread.
@eeumay , thanks for raising this issue and working to resolve it. Would you like to submit a PR with the fix?
from openthread.
@eeumay , thanks for raising this issue and working to resolve it. Would you like to submit a PR with the fix?
I'm on it. I will submit a PR and I'm waiting for GitHub Actions. But for copying option correctly, optionBuf should be uint8_t array. I'm not sure how to define a fixed langth adapting to an uncertain length due to the theoretical max is too big, and I decide to use the max length of the uri path which is necessary. Do you have any advice?
from openthread.
I'm on it. I will submit a PR and I'm waiting for GitHub Actions. But for copying option correctly, optionBuf should be uint8_t array. I'm not sure how to define a fixed langth adapting to an uncertain length due to the theoretical max is too big, and I decide to use the max length of the uri path which is necessary. Do you have any advice?
@eeumay , good observation. I believe the length issue was present in the original contribution:
@abtink , who last updated the ReadOptionValue()
method, any thoughts on how to address?
from openthread.
Using a fixed (max size) array can work but would be limited.
A more flexible (but more complex) approach can be to add a new AppendOption()
flavor that directly copies the option value from a passed Option::Iterator
. It can then copy the bytes from one message to another using Message::AppendBytesFromMessage()
, eliminating the need for an intermediate buffer.
from openthread.
@jwhui @abtink Thanks for your advice.
I submit a PR to fix copying option.#9894
But it still failed that Coap parsed the previous old request (in CoapBase::PrepareNextBlockRequest()
), because CoapBase::FindRelatedRequest()
did return a Message appending metaData, which cannot be directly iterated. In this case, Option::Iterator::Read()
would reach metaData and probably return kErrorParse
.
I will open another issue to talk about it.
from openthread.
Related Issues (20)
- openthread-br on openwrt 23.05.03 thread device no fd11 address
- How should the payload data be packaged when using CoAP for PUT/POST? HOT 2
- Request for a new hook that occurs after Host gets RCP capabilities HOT 4
- unexpected test failing test_mlr_multicast_routing_across_thread_pans.py HOT 1
- unexpected test failing test_manual_maddress.py
- Data poll delayed when receiving fragmented packets HOT 8
- HardFault during otInstance initialization HOT 1
- Reading information from socket failed (Apple Homepod mini as Thread Border Router)
- Add ICMPv6 Destination Unreachable sending for Border Router (SPEC-1218)
- Unit test for multipan isn't run by CI
- `dataset` pending failures HOT 9
- ot-ctl does not exit
- support all the otCoapSend*WithParameters but for otCoapSecure HOT 2
- There are some cases where OT (or Matter) loses track of matter services HOT 6
- SRP client registers mesh-local IP address in some topology scenarios HOT 2
- How to tune OPENTHREAD_CONFIG to 32 child per parent HOT 1
- [Thread 1.3.x / 1.4] related OT PRs and Thread JIRAs
- Address queries are forwarded by the node even though it is the one which resolves the address HOT 12
- Intermittent CoAP ACK Reception Issues with Multiple nRF52840 Nodes in Thread Network HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openthread.