From: Jim Radford Date: Mon, 19 Aug 2013 23:07:28 +0000 (-0700) Subject: curl_json plugin: don't complain about not finding expected maps in arrays X-Git-Tag: collectd-5.5.0~119^2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=78ed4f1c4a8130497ff656a93e99e15979ee14db;p=collectd.git curl_json plugin: don't complain about not finding expected maps in arrays The arrays may have mixed maps and scalars. I'm looking at you Solr. --- diff --git a/src/curl_json.c b/src/curl_json.c index 511863e3..b7eaf399 100644 --- a/src/curl_json.c +++ b/src/curl_json.c @@ -229,7 +229,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 = */ 0);