This is an automated email from the ASF dual-hosted git repository. astitcher pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/qpid-proton.git
The following commit(s) were added to refs/heads/main by this push: new 8a289c7 PROTON-2448: Fix the frame trace not to dump null fields in described lists 8a289c7 is described below commit 8a289c78f7ca24849369d508577f913ff307a7ca Author: Andrew Stitcher <astitc...@apache.org> AuthorDate: Wed Dec 22 19:10:44 2021 -0500 PROTON-2448: Fix the frame trace not to dump null fields in described lists --- c/src/core/value_dump.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/c/src/core/value_dump.c b/c/src/core/value_dump.c index 05b39fc..ac4e0c0 100644 --- a/c/src/core/value_dump.c +++ b/c/src/core/value_dump.c @@ -346,19 +346,26 @@ void pn_value_dump_list(uint32_t count, pn_bytes_t value, pn_string_t *output) { void pn_value_dump_described_list(uint32_t count, pn_bytes_t value, uint64_t dcode, pn_string_t *output) { uint32_t elements = 0; + bool output_element = false; pn_string_addf(output, "["); while (value.size) { - const pn_fields_t *fields = &FIELDS[dcode-FIELD_MIN]; - if (elements < fields->field_count) { - pn_string_addf(output, "%s=", - (const char*)FIELD_STRINGPOOL.STRING0+FIELD_FIELDS[fields->first_field_index+elements]); + uint8_t type = value.start[0]; + if (type==PNE_NULL) { + value = pn_bytes_advance(value, 1); + } else { + if (output_element) { + pn_string_addf(output, ", "); + } + const pn_fields_t *fields = &FIELDS[dcode-FIELD_MIN]; + if (elements < fields->field_count) { + pn_string_addf(output, "%s=", + (const char*)FIELD_STRINGPOOL.STRING0+FIELD_FIELDS[fields->first_field_index+elements]); + } + size_t size = pn_value_dump(value, output); + value = pn_bytes_advance(value, size); + output_element = true; } elements++; - size_t size = pn_value_dump(value, output); - value = pn_bytes_advance(value, size); - if (value.size) { - pn_string_addf(output, ", "); - } } pn_string_addf(output, "]"); if (elements!=count) { --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org For additional commands, e-mail: commits-h...@qpid.apache.org