X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fcurl_json.c;h=09db7866fa8bdbc3465184c6820e38e3a94ee868;hb=dd8429c16bc57f949abb2537e003b76ad88b6f90;hp=e99500aa554a3bc9147b664229f73cd44749d011;hpb=3c15b0e6fa66db107025ae08d3bbb9824d987a89;p=collectd.git diff --git a/src/curl_json.c b/src/curl_json.c index e99500aa..09db7866 100644 --- a/src/curl_json.c +++ b/src/curl_json.c @@ -231,7 +231,7 @@ static int cj_cb_number (void *ctx, buffer[sizeof (buffer) - 1] = 0; if ((key == NULL) || !CJ_IS_KEY (key)) { - if (key != NULL) + if (key != NULL && !db->state[db->depth].in_array/*can be inhomogeneous*/) NOTICE ("curl_json plugin: Found \"%s\", but the configuration expects" " a map.", buffer); cj_cb_inc_array_index (ctx, /* update_key = */ 1); @@ -608,6 +608,8 @@ static int cj_init_curl (cj_t *db) /* {{{ */ curl_easy_setopt (db->curl, CURLOPT_USERAGENT, COLLECTD_USERAGENT); curl_easy_setopt (db->curl, CURLOPT_ERRORBUFFER, db->curl_errbuf); curl_easy_setopt (db->curl, CURLOPT_URL, db->url); + curl_easy_setopt (db->curl, CURLOPT_FOLLOWLOCATION, 1L); + curl_easy_setopt (db->curl, CURLOPT_MAXREDIRS, 50L); if (db->user != NULL) {