octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #63573] Build warnings from curl library


From: Arun Giridhar
Subject: [Octave-bug-tracker] [bug #63573] Build warnings from curl library
Date: Wed, 11 Jan 2023 12:59:05 -0500 (EST)

Follow-up Comment #3, bug #63573 (project octave):

Changing the constants was OK but changing the function names requires more
thought to ensure the wrapping is correct.

WIP patch that removes two of the warnings:

diff -r d6b208b30d4c liboctave/util/url-transfer.cc
--- a/liboctave/util/url-transfer.cc    Tue Jan 10 14:32:34 2023 -0800
+++ b/liboctave/util/url-transfer.cc    Wed Jan 11 12:58:23 2023 -0500
@@ -577,7 +577,7 @@ public:
     curl_easy_getinfo (m_curl, CURLINFO_FILETIME, &ft);
     filetime = ft;
     double fs;
-    curl_easy_getinfo (m_curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &fs);
+    curl_easy_getinfo (m_curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD_T, &fs);
     filesize = fs;
 
     SETOPT (CURLOPT_WRITEFUNCTION, write_data);
@@ -712,11 +712,13 @@ public:
   // path of the file as its value.
   void form_data_post (const Array<std::string>& param)
   {
+    // FIXME: change type curl_httppost* to type curl_mime*
     struct curl_httppost *post = nullptr;
     struct curl_httppost *last = nullptr;
 
     SETOPT (CURLOPT_URL, m_host_or_url.c_str ());
 
+    // FIXME: change curl_formfree needs to curl_mime_free()
     unwind_action cleanup_httppost ([=] () { curl_formfree (post); });
 
     if (param.numel () >= 2)
@@ -727,14 +729,16 @@ public:
             std::string data = param(i+1);
 
             if (name == "file")
+              // FIXME: change curl_formadd to curl_mime_init()
               curl_formadd (&post, &last, CURLFORM_COPYNAME, name.c_str (),
                             CURLFORM_FILE, data.c_str (), CURLFORM_END);
             else
+              // FIXME: change curl_formadd to curl_mime_init()
               curl_formadd(&post, &last, CURLFORM_COPYNAME, name.c_str (),
                            CURLFORM_COPYCONTENTS, data.c_str (),
CURLFORM_END);
           }
 
-        SETOPT (CURLOPT_HTTPPOST, post);
+        SETOPT (CURLOPT_MIMEPOST, post);
       }
 
     perform ();




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?63573>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]