Skip to content

Commit

Permalink
Add CURLOPT_POSTFIELDSIZE to address SAM issue 1830
Browse files Browse the repository at this point in the history
  • Loading branch information
sjanzou committed Aug 16, 2024
1 parent edc2573 commit 4d787dd
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/easycurl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,15 @@ class wxEasyCurl::DLThread : public wxThread {
wxString encoded = uri.BuildURI();
curl_easy_setopt(curl, CURLOPT_URL, (const char *) encoded.c_str());

if (!m_sc->m_postData.IsEmpty())
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, (const char *) m_sc->m_postData.c_str());
if (!m_sc->m_postData.IsEmpty()) {
// SAM issue 1830
auto len = m_sc->m_postData.length();
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, len);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, (const char*)m_sc->m_postData.c_str());
// wxURI uriPostdata(m_sc->m_postData);
// wxString encodedPostData = uriPostdata.BuildURI();
// curl_easy_setopt(curl, CURLOPT_POSTFIELDS, (const char*)encodedPostData.c_str());
}

curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
Expand Down

0 comments on commit 4d787dd

Please sign in to comment.