CURL* curl = NULL;
program_config* config = NULL;
+char errbuf[CURL_ERROR_SIZE];
void _kds_s2000w_client_print_error_status(CURL* curl)
{
if (result == CURLE_OK)
return;
+ size_t len = strlen(errbuf);
+ if (len > 0) {
+ debug_printf(ERROR, errbuf);
+ errbuf[0] = 0;
+ return;
+ }
+
debug_printf(ERROR, curl_easy_strerror(result));
}
config = load_config(config_stream);
curl_global_init(CURL_GLOBAL_SSL);
curl = curl_easy_init();
+ errbuf[0] = 0;
free(config_stream);
config_stream = NULL;
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, body);
_kds_s2000w_client_set_ssl_verification_off(curl);
+ curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errbuf);
CURLcode result = curl_easy_perform(curl);
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &resp->code);
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELETE");
_kds_s2000w_client_set_ssl_verification_off(curl);
+ curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errbuf);
CURLcode result = curl_easy_perform(curl);
_kds_s2000w_client_print_error_result(result);
curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L);
_kds_s2000w_client_set_ssl_verification_off(curl);
+ curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errbuf);
CURLcode result = curl_easy_perform(curl);
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &resp->code);
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, 0L);
_kds_s2000w_client_set_ssl_verification_off(curl);
+ curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errbuf);
CURLcode result = curl_easy_perform(curl);
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &resp->code);
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, 0L);
_kds_s2000w_client_set_ssl_verification_off(curl);
+ curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errbuf);
CURLcode result = curl_easy_perform(curl);
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &resp->code);
curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L);
_kds_s2000w_client_set_ssl_verification_off(curl);
+ curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errbuf);
CURLcode result = curl_easy_perform(curl);
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &resp->code);
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELETE");
_kds_s2000w_client_set_ssl_verification_off(curl);
+ curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errbuf);
CURLcode result = curl_easy_perform(curl);
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &resp->code);
curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L);
_kds_s2000w_client_set_ssl_verification_off(curl);
+ curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errbuf);
CURLcode result = curl_easy_perform(curl);
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &resp->code);
curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L);
_kds_s2000w_client_set_ssl_verification_off(curl);
+ curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errbuf);
CURLcode result = curl_easy_perform(curl);
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &resp->code);
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "PUT");
_kds_s2000w_client_set_ssl_verification_off(curl);
+ curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errbuf);
CURLcode result = curl_easy_perform(curl);
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &resp->code);