Skip to content

Commit

Permalink
Print input VPs to the log
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed Nov 26, 2013
1 parent 6b2fe7a commit d3c1098
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/main/unittest.c
Expand Up @@ -152,6 +152,28 @@ static REQUEST *request_setup(FILE *fp)
return NULL;
}

if (debug_flag) {
VALUE_PAIR *vp;
vp_cursor_t cursor;

for (vp = fr_cursor_init(&cursor, &request->packet->vps);
vp;
vp = fr_cursor_next(&cursor)) {
/*
* Take this opportunity to verify all the VALUE_PAIRs are still valid.
*/
if (!talloc_get_type(vp, VALUE_PAIR)) {
ERROR("Expected VALUE_PAIR pointer got \"%s\"", talloc_get_name(vp));

log_talloc_report(vp);
rad_assert(0);
}

vp_print(fr_log_fp, vp);
}
fflush(fr_log_fp);
}

/*
* FIXME: set IPs, etc.
*/
Expand Down

0 comments on commit d3c1098

Please sign in to comment.