diff --git a/src/modules/rlm_rest/rest.c b/src/modules/rlm_rest/rest.c index 63a059f4acea..202a72ff5f44 100644 --- a/src/modules/rlm_rest/rest.c +++ b/src/modules/rlm_rest/rest.c @@ -226,11 +226,11 @@ typedef struct rest_custom_data { /** Flags to control the conversion of JSON values to VALUE_PAIRs. * * These fields are set when parsing the expanded format for value pairs in - * JSON, and control how json_pair_make_leaf and json_pair_make convert the JSON + * JSON, and control how json_pair_alloc_leaf and json_pair_alloc convert the JSON * value, and move the new VALUE_PAIR into an attribute list. * - * @see json_pair_make - * @see json_pair_make_leaf + * @see json_pair_alloc + * @see json_pair_alloc_leaf */ typedef struct json_flags { int do_xlat; //!< If true value will be expanded with xlat. @@ -890,7 +890,7 @@ static int rest_decode_post(UNUSED rlm_rest_t const *instance, UNUSED rlm_rest_s * - #VALUE_PAIR just created. * - NULL on error. */ -static VALUE_PAIR *json_pair_make_leaf(UNUSED rlm_rest_t const *instance, UNUSED rlm_rest_section_t const *section, +static VALUE_PAIR *json_pair_alloc_leaf(UNUSED rlm_rest_t const *instance, UNUSED rlm_rest_section_t const *section, TALLOC_CTX *ctx, REQUEST *request, fr_dict_attr_t const *da, json_flags_t *flags, json_object *leaf) { @@ -1027,7 +1027,7 @@ static VALUE_PAIR *json_pair_make_leaf(UNUSED rlm_rest_t const *instance, UNUSED * - Number of attributes created. * - < 0 on error. */ -static int json_pair_make(rlm_rest_t const *instance, rlm_rest_section_t const *section, +static int json_pair_alloc(rlm_rest_t const *instance, rlm_rest_section_t const *section, REQUEST *request, json_object *object, UNUSED int level, int max) { int max_attrs = max; @@ -1139,7 +1139,7 @@ static int json_pair_make(rlm_rest_t const *instance, rlm_rest_section_t const * } /* - * Setup fr_pair_make / recursion loop. + * Setup fr_pair_alloc / recursion loop. */ if (!flags.is_json && fr_json_object_is_type(value, json_type_array)) { elements = json_object_array_length(value); @@ -1177,12 +1177,12 @@ static int json_pair_make(rlm_rest_t const *instance, rlm_rest_section_t const * continue; /* - vp = json_pair_make(instance, section, + vp = json_pair_alloc(instance, section, request, value, level + 1, max_attrs);*/ } else { - vp = json_pair_make_leaf(instance, section, ctx, request, - dst->tmpl_da, &flags, element); + vp = json_pair_alloc_leaf(instance, section, ctx, request, + dst->tmpl_da, &flags, element); if (!vp) continue; } RDEBUG2("&%pP", vp); @@ -1202,12 +1202,12 @@ static int json_pair_make(rlm_rest_t const *instance, rlm_rest_section_t const * /** Converts JSON response into VALUE_PAIRs and adds them to the request. * * Converts the raw JSON string into a json-c object tree and passes it to - * json_pair_make. After the tree has been parsed json_object_put is called + * json_pair_alloc. After the tree has been parsed json_object_put is called * which decrements the reference count of the root node by one, and frees * the entire tree. * * @see rest_encode_json - * @see json_pair_make + * @see json_pair_alloc * * @param[in] instance configuration data. * @param[in] section configuration data. @@ -1240,7 +1240,7 @@ static int rest_decode_json(rlm_rest_t const *instance, rlm_rest_section_t const return -1; } - ret = json_pair_make(instance, section, request, json, 0, REST_BODY_MAX_ATTRS); + ret = json_pair_alloc(instance, section, request, json, 0, REST_BODY_MAX_ATTRS); /* * Decrement reference count for root object, should free entire JSON tree.