Skip to content

Commit

Permalink
add API to clear request_data
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed Dec 9, 2019
1 parent 1d764ca commit 33c8af9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/lib/server/request_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,3 +653,17 @@ bool request_data_verify_parent(TALLOC_CTX *parent, fr_dlist_head_t *entry)
return true;
}
#endif

/** Clear all of the request data associated with a request.
*
*/
int request_data_clear(REQUEST *request)
{
request_data_t *rd = NULL;

while ((rd = fr_dlist_next(&request->data, rd))) {
if (talloc_free(rd) < 0) return -1;
}

return 0;
}
2 changes: 2 additions & 0 deletions src/lib/server/request_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ bool request_data_persistable(request_data_t *rd);
bool request_data_verify_parent(TALLOC_CTX *parent, fr_dlist_head_t *entry);
#endif

int request_data_clear(REQUEST *request);

#ifdef __cplusplus
}
#endif

0 comments on commit 33c8af9

Please sign in to comment.