-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
chip-tool PersistentStorage: support for CASE resumption keys #20220
Conversation
@@ -95,6 +117,10 @@ CHIP_ERROR PersistentStorage::Init(const char * name) | |||
mName = name; | |||
mConfig.parse(ifs); | |||
ifs.close(); | |||
|
|||
// inipp.h cannot deal with keys containing '=' and does not support escapes either | |||
AdjustConfig(mConfig.sections); |
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.
We could escape the key any way we want though.
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.
Yes but not in any standard way such as backslash=. It would also slow down all operations. This way we only do it once.
PR #20220: Size comparison from 6c6dca3 to bf2dec2 Increases (5 builds for cc13x2_26x2, linux, telink)
Decreases (4 builds for cc13x2_26x2, cyw30739)
Full report (41 builds for cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, p6, telink)
|
std::string key = it->first; | ||
const char * value = it->second.c_str(); | ||
|
||
while (value[0] == '=') |
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 this is assuming that values don't actually ever start with '=', right? I guess that's true because we base64-encode the values? Might be worth documenting that...
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.
It appears this is superseded by #20239. Correct?
In the meantime fixed by #20239 |
Problem
chip-tool PersistentStorage is broken with CASE resumption which uses keys containing '='. It can write the key/value pairs but upon read they end up something different. As a result console is flooded with error messages since none of the keys can be found.
Change overview
Make sure that CASE resumption key/values read match the written ones.
Testing