X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcurl_json.c;h=55d4cd539d64b083eec5a0f28e3d27580579a383;hb=e35f3c5c634216860f14586a7d17232022d8b588;hp=21deed61a1e1192ca12bfdf11208a0de4582c461;hpb=97addf1e406c75be500ae020635f3cb389f206e0;p=collectd.git diff --git a/src/curl_json.c b/src/curl_json.c index 21deed61..55d4cd53 100644 --- a/src/curl_json.c +++ b/src/curl_json.c @@ -279,7 +279,7 @@ static int cj_cb_start_array (void * ctx) static int cj_cb_end_array (void * ctx) { - return cj_cb_start (ctx); + return cj_cb_end (ctx); } static yajl_callbacks ycallbacks = { @@ -535,6 +535,7 @@ static int cj_init_curl (cj_t *db) /* {{{ */ return (-1); } + curl_easy_setopt (db->curl, CURLOPT_NOSIGNAL, 1); curl_easy_setopt (db->curl, CURLOPT_WRITEFUNCTION, cj_curl_callback); curl_easy_setopt (db->curl, CURLOPT_WRITEDATA, db); curl_easy_setopt (db->curl, CURLOPT_USERAGENT, @@ -764,6 +765,7 @@ static int cj_curl_perform (cj_t *db, CURL *curl) /* {{{ */ if (db->yajl == NULL) { ERROR ("curl_json plugin: yajl_alloc failed."); + db->yajl = yprev; return (-1); }