if(!curl)
return;
+ CURLU* url_handler = curl_url();
+ curl_url_set(url_handler, CURLUPART_URL, p_config.scanner_url, 0);
+ curl_url_set(url_handler, CURLUPART_PATH, "/api/session", 0);
+ char* url = NULL;
+ curl_url_get(url_handler, CURLUPART_URL, &url, 0);
+
struct curl_slist* headers = NULL;
char header_str[80];
sprintf(header_str, "SessionId: %li", sessionid);
headers = curl_slist_append(headers, header_str);
- curl_easy_setopt(curl, CURLOPT_URL, "http://scanner.lan.hhaalo.de/api/session");
+ curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_perform(curl);
+ curl_url_cleanup(url_handler);
+ url_handler = NULL;
+ curl_free(url);
+ url = NULL;
curl_slist_free_all(headers);
headers = NULL;
curl_easy_cleanup(curl);