From: Nick Porter Date: Sat, 9 Jan 2021 14:04:28 +0000 (+0000) Subject: s/fr_cursor/fr_dcursor/ in rlm_rest/rest.c X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=12b6ea41e920e2aab13475c1cdff480f8c9ec67a;p=thirdparty%2Ffreeradius-server.git s/fr_cursor/fr_dcursor/ in rlm_rest/rest.c --- diff --git a/src/modules/rlm_rest/rest.c b/src/modules/rlm_rest/rest.c index e184eb442b5..5359856989c 100644 --- a/src/modules/rlm_rest/rest.c +++ b/src/modules/rlm_rest/rest.c @@ -378,7 +378,7 @@ static size_t rest_encode_post(void *out, size_t size, size_t nmemb, void *userd if (ctx->state == READ_STATE_INIT) ctx->state = READ_STATE_ATTR_BEGIN; while (freespace > 0) { - vp = fr_cursor_current(&ctx->cursor); + vp = fr_dcursor_current(&ctx->cursor); if (!vp) { ctx->state = READ_STATE_END; @@ -469,7 +469,7 @@ static size_t rest_encode_post(void *out, size_t size, size_t nmemb, void *userd /* * there are more attributes, insert a separator */ - if (fr_cursor_next(&ctx->cursor)) { + if (fr_dcursor_next(&ctx->cursor)) { if (freespace < 1) goto no_space; *p++ = '&'; freespace--; @@ -1729,7 +1729,7 @@ int rest_request_config(rlm_rest_t const *inst, rlm_rest_thread_t *t, rlm_rest_s char const *content_type; fr_pair_t *header; - fr_cursor_t headers; + fr_dcursor_t headers; char buffer[512]; @@ -1793,10 +1793,10 @@ int rest_request_config(rlm_rest_t const *inst, rlm_rest_thread_t *t, rlm_rest_s ctx->headers = curl_slist_append(ctx->headers, buffer); if (!ctx->headers) goto error_header; - for (header = fr_cursor_iter_by_da_init(&headers, &request->control_pairs, attr_rest_http_header); + for (header = fr_dcursor_iter_by_da_init(&headers, &request->control_pairs, attr_rest_http_header); header; - header = fr_cursor_next(&headers)) { - header = fr_cursor_remove(&headers); + header = fr_dcursor_next(&headers)) { + header = fr_dcursor_remove(&headers); if (!strchr(header->vp_strvalue, ':')) { RWDEBUG("Invalid HTTP header \"%s\" must be in format ': '. Skipping...", header->vp_strvalue); @@ -2022,7 +2022,7 @@ do {\ case REST_HTTP_BODY_POST: rest_request_init(section, request, &ctx->request); - fr_cursor_init(&(ctx->request.cursor), &request->request_pairs); + fr_dcursor_init(&(ctx->request.cursor), &request->request_pairs); if (rest_request_config_body(inst, section, request, randle, rest_encode_post) < 0) return -1; diff --git a/src/modules/rlm_rest/rest.h b/src/modules/rlm_rest/rest.h index 827286e0632..b1e766eae25 100644 --- a/src/modules/rlm_rest/rest.h +++ b/src/modules/rlm_rest/rest.h @@ -214,7 +214,7 @@ typedef struct { request_t *request; //!< Current request. read_state_t state; //!< Encoder state - fr_cursor_t cursor; //!< Cursor pointing to the start of the list to encode. + fr_dcursor_t cursor; //!< Cursor pointing to the start of the list to encode. size_t chunk; //!< Chunk size