#include "kds_s2000w_client.h"
#include "kds_s2000w_debug.h"
+CURL* curl = NULL;
+
void _kds_s2000w_client_read_error_status(CURL* curl, response* resp)
{
struct curl_header* header = NULL;
return resp;
}
+void kds_s2000w_client_init()
+{
+ debug_printf(ALL, "kds_s2000w_client_init");
+
+ curl = curl_easy_init();
+}
+
+void kds_s2000w_client_free()
+{
+ debug_printf(ALL, "kds_s2000w_client_free");
+
+ curl_easy_cleanup(curl);
+ curl = NULL;
+}
+
void kds_s2000w_client_response_free(response* response)
{
debug_printf(ALL, "kds_s2000w_client_response_free");
debug_printf(ALL, "kds_s2000w_client_open_session");
_kds_s2000w_client_load_config();
+ curl_easy_reset(curl);
char* url = NULL;
char body[50] = {0};
url_handler = NULL;
curl_free(url);
url = NULL;
- curl_easy_cleanup(curl);
- curl = NULL;
free(buffer);
buffer = NULL;
free(sizeloc);
struct curl_slist* headers = NULL;
char header_str[80];
- CURL* curl = curl_easy_init();
- if(!curl)
- return;
+ curl_easy_reset(curl);
CURLU* url_handler = curl_url();
curl_url_set(url_handler, CURLUPART_URL, p_config.scanner_url, 0);
url = NULL;
curl_slist_free_all(headers);
headers = NULL;
- curl_easy_cleanup(curl);
- curl = NULL;
}
int kds_s2000w_client_status_session(int64_t sessionid, response* response)
struct curl_slist* headers = NULL;
char header_str[80];
- CURL* curl = curl_easy_init();
- if(!curl)
- return CURLE_FAILED_INIT;
+ curl_easy_reset(curl);
CURLU* url_handler = curl_url();
curl_url_set(url_handler, CURLUPART_URL, p_config.scanner_url, 0);
url_handler = NULL;
curl_free(url);
url = NULL;
- curl_easy_cleanup(curl);
- curl = NULL;
free(buffer);
buffer = NULL;
free(sizeloc);
struct curl_slist* headers = NULL;
char header_str[80];
- CURL* curl = curl_easy_init();
- if(!curl)
- return CURLE_FAILED_INIT;
+ curl_easy_reset(curl);
CURLU* url_handler = curl_url();
curl_url_set(url_handler, CURLUPART_URL, p_config.scanner_url, 0);
url_handler = NULL;
curl_free(url);
url = NULL;
- curl_easy_cleanup(curl);
- curl = NULL;
free(buffer);
buffer = NULL;
free(sizeloc);
struct curl_slist* headers = NULL;
char header_str[80];
- CURL* curl = curl_easy_init();
- if(!curl)
- return CURLE_FAILED_INIT;
+ curl_easy_reset(curl);
CURLU* url_handler = curl_url();
curl_url_set(url_handler, CURLUPART_URL, p_config.scanner_url, 0);
url_handler = NULL;
curl_free(url);
url = NULL;
- curl_easy_cleanup(curl);
- curl = NULL;
free(buffer);
buffer = NULL;
free(sizeloc);
char url_path[30];
char header_str[80];
- CURL* curl = curl_easy_init();
- if(!curl)
- return CURLE_FAILED_INIT;
+ curl_easy_reset(curl);
CURLU* url_handler = curl_url();
sprintf(url_path, "api/session/image/%i", img_number);
url_handler = NULL;
curl_free(url);
url = NULL;
- curl_easy_cleanup(curl);
- curl = NULL;
free(buffer);
buffer = NULL;
free(sizeloc);
char url_path[30];
char header_str[80];
- CURL* curl = curl_easy_init();
- if(!curl)
- return CURLE_FAILED_INIT;
+ curl_easy_reset(curl);
CURLU* url_handler = curl_url();
sprintf(url_path, "api/session/image/%i", img_number);
url_handler = NULL;
curl_free(url);
url = NULL;
- curl_easy_cleanup(curl);
- curl = NULL;
free(buffer);
buffer = NULL;
free(sizeloc);
char* url = NULL;
- CURL* curl = curl_easy_init();
- if(!curl)
- return CURLE_FAILED_INIT;
+ curl_easy_reset(curl);
CURLU* url_handler = curl_url();
curl_url_set(url_handler, CURLUPART_URL, p_config.scanner_url, 0);
url_handler = NULL;
curl_free(url);
url = NULL;
- curl_easy_cleanup(curl);
- curl = NULL;
free(buffer);
buffer = NULL;
free(sizeloc);
struct curl_slist* headers = NULL;
char header_str[80];
- CURL* curl = curl_easy_init();
- if(!curl)
- return CURLE_FAILED_INIT;
+ curl_easy_reset(curl);
CURLU* url_handler = curl_url();
curl_url_set(url_handler, CURLUPART_URL, p_config.scanner_url, 0);
url_handler = NULL;
curl_free(url);
url = NULL;
- curl_easy_cleanup(curl);
- curl = NULL;
free(buffer);
buffer = NULL;
free(sizeloc);
struct curl_slist* headers = NULL;
char header_str[80];
- CURL* curl = curl_easy_init();
- if(!curl)
- return CURLE_FAILED_INIT;
+ curl_easy_reset(curl);
CURLU* url_handler = curl_url();
curl_url_set(url_handler, CURLUPART_URL, p_config.scanner_url, 0);
url_handler = NULL;
curl_free(url);
url = NULL;
- curl_easy_cleanup(curl);
- curl = NULL;
return result;
}
\ No newline at end of file