- curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1L);
- curl_easy_setopt(cb->curl, CURLOPT_USERAGENT,
- PACKAGE_NAME "/" PACKAGE_VERSION);
- char curl_errbuf[CURL_ERROR_SIZE];
- curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, curl_errbuf);
- curl_easy_setopt(curl, CURLOPT_URL, final_url);
- curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
- curl_easy_setopt(curl, CURLOPT_POST, 1L);
- curl_easy_setopt(curl, CURLOPT_POSTFIELDS, payload);
-
- wg_memory_t res = {
- .memory = NULL, .size = 0,
- };
- curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, wg_write_memory_cb);
- curl_easy_setopt(curl, CURLOPT_WRITEDATA, &res);
+ yajl_val code = yajl_tree_get(root, (char const *[]){"error", "code", NULL},
+ yajl_t_number);
+ if (YAJL_IS_INTEGER(code)) {
+ err->code = YAJL_GET_INTEGER(code);
+ }