MT#55283 skip unparsed flags objects

The parser currently relies on the appropriate parsing functions
(dict_iter, list_iter) to be called to advance into and back out of any
sub-objects containd within the flags string. However, if an unknown key
is encountered, no parsing functions would be invoked, resulting in the
parser not skipping over the sub-object and subsequently a stray error
message in the log. Work around this by detecting unparsed objects and
then using a dummy list_iter to return to a good parsing position.

Change-Id: I908aff8b9be8d12644a9faea0dcf3bf3535faf32
pull/1910/head
Richard Fuchs 3 months ago
parent 15fa36df30
commit 4da2f90473

@ -224,6 +224,8 @@ static bool rtpp_dict_iter(const ng_parser_t *parser, rtpp_pos *pos,
break; // nothing left
callback(parser, &key, pos, arg);
if (rtpp_is_dict_list(pos))
rtpp_list_iter(parser, pos, NULL, NULL, NULL);
if (end)
break;
goto next;
@ -434,6 +436,8 @@ generic:
else {
rtpp_pos pos = { .cur = val, .remainder = remainder };
call_ng_main_flags(&dummy_parser, &key, &pos, out);
if (rtpp_is_dict_list(&pos))
rtpp_list_iter(&dummy_parser, &pos, NULL, NULL, NULL);
remainder = pos.remainder;
}

Loading…
Cancel
Save