Skip to content

Commit

Permalink
internal: Last of the decoder fixes
Browse files Browse the repository at this point in the history
VP printing functions need fixing next....
  • Loading branch information
arr2036 committed Apr 1, 2020
1 parent 2b54d12 commit 766ad87
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/protocols/internal/decode.c
Expand Up @@ -80,7 +80,7 @@ static ssize_t internal_decode_tlv(TALLOC_CTX *ctx, fr_pair_list_t *head, fr_dic

memset(&children, 0, sizeof(children));

FR_PROTO_TRACE("Decoding TLV - %s", parent_da->name);
FR_PROTO_TRACE("Decoding TLV - %s (%zu bytes)", parent_da->name, end - start);

/*
* Decode all the children of this TLV
Expand All @@ -91,6 +91,8 @@ static ssize_t internal_decode_tlv(TALLOC_CTX *ctx, fr_pair_list_t *head, fr_dic
slen = internal_decode_pair(ctx, &children, parent_da, p, end, decoder_ctx);
if (slen <= 0) return slen;

FR_PROTO_TRACE("Returned %zu", slen);

p += slen;
}

Expand All @@ -106,9 +108,7 @@ static ssize_t internal_decode_tlv(TALLOC_CTX *ctx, fr_pair_list_t *head, fr_dic
tlv = fr_pair_afrom_da(ctx, parent_da);
if (!tlv) return PAIR_DECODE_OOM;

for (vp = fr_cursor_head(&cursor);
vp;
vp = fr_cursor_next(&cursor)) {
while ((vp = fr_cursor_head(&cursor))) {
FR_PROTO_TRACE("Moving %s into %s", vp->da->name, tlv->da->name);
fr_pair_add(&tlv->vp_group, talloc_reparent(ctx, tlv, fr_cursor_remove(&cursor)));
}
Expand Down

0 comments on commit 766ad87

Please sign in to comment.