if (status != CURLE_OK) {
ERROR("write_stackdriver plugin: POST %s failed: %s", url, cb->curl_errbuf);
- sfree(ret_content->memory);
- ret_content->size = 0;
+ if (ret_content != NULL) {
+ sfree(ret_content->memory);
+ ret_content->size = 0;
+ }
return -1;
}
curl_easy_getinfo(cb->curl, CURLINFO_RESPONSE_CODE, &http_code);
if (ret_content != NULL) {
- if ((status >= 400) && (status < 500)) {
+ if ((http_code >= 400) && (http_code < 500)) {
ERROR("write_stackdriver plugin: POST %s: %s", url,
API_ERROR_STRING(parse_api_error(ret_content->memory)));
- } else if (status >= 500) {
+ } else if (http_code >= 500) {
WARNING("write_stackdriver plugin: POST %s: %s", url,
ret_content->memory);
}
char *payload = sd_output_reset(cb->formatter);
int status = wg_call_timeseries_write(cb, payload);
- if (status != 0) {
- ERROR("write_stackdriver plugin: Sending buffer failed with status %d.",
- status);
- }
-
wg_reset_buffer(cb);
return status;
} /* }}} wg_flush_nolock */