Skip to content

Commit

Permalink
Issue #409: coveralls-writer: Correct libcurl deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonKagstrom committed Oct 14, 2023
1 parent 4efe5e4 commit 7b0c3ae
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/writers/coveralls-writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,19 @@ class CurlConnectionHandler
{
m_writtenData = "";

struct curl_httppost *formpost = NULL;
struct curl_httppost *lastptr = NULL;
CURLcode res;

curl_formadd(&formpost,
&lastptr,
CURLFORM_COPYNAME, "json_file",
CURLFORM_FILE, fileName.c_str(),
CURLFORM_END);
auto formpost = curl_mime_init(m_curl);
auto part = curl_mime_addpart(formpost);

curl_easy_setopt(m_curl, CURLOPT_HTTPPOST, formpost);
curl_mime_name(part, "json_file");
curl_mime_filedata(part, fileName.c_str());

curl_easy_setopt(m_curl, CURLOPT_MIMEPOST, formpost);

res = curl_easy_perform(m_curl);

curl_formfree(formpost);
curl_mime_free(formpost);

if (res != CURLE_OK)
return false;
Expand Down

0 comments on commit 7b0c3ae

Please sign in to comment.