mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-16 10:06:41 +00:00
Lower libcurl requirement further still
This allows us to build on Ubuntu 16.04!
This commit is contained in:
parent
a14de30153
commit
c0d4c09a02
@ -65,7 +65,9 @@ typedef struct {
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
CURL *curl;
|
CURL *curl;
|
||||||
|
#ifdef HAVE_LIBCURL_7_56_0
|
||||||
curl_mime *mime;
|
curl_mime *mime;
|
||||||
|
#endif
|
||||||
struct curl_slist *headers;
|
struct curl_slist *headers;
|
||||||
} FwupdCurlHelper;
|
} FwupdCurlHelper;
|
||||||
|
|
||||||
@ -106,8 +108,10 @@ fwupd_client_curl_helper_free (FwupdCurlHelper *helper)
|
|||||||
{
|
{
|
||||||
if (helper->curl != NULL)
|
if (helper->curl != NULL)
|
||||||
curl_easy_cleanup (helper->curl);
|
curl_easy_cleanup (helper->curl);
|
||||||
|
#ifdef HAVE_LIBCURL_7_56_0
|
||||||
if (helper->mime != NULL)
|
if (helper->mime != NULL)
|
||||||
curl_mime_free (helper->mime);
|
curl_mime_free (helper->mime);
|
||||||
|
#endif
|
||||||
if (helper->headers != NULL)
|
if (helper->headers != NULL)
|
||||||
curl_slist_free_all (helper->headers);
|
curl_slist_free_all (helper->headers);
|
||||||
g_free (helper);
|
g_free (helper);
|
||||||
@ -4263,6 +4267,7 @@ fwupd_client_upload_bytes_async (FwupdClient *self,
|
|||||||
/* build message */
|
/* build message */
|
||||||
if ((flags & FWUPD_CLIENT_UPLOAD_FLAG_ALWAYS_MULTIPART) > 0 ||
|
if ((flags & FWUPD_CLIENT_UPLOAD_FLAG_ALWAYS_MULTIPART) > 0 ||
|
||||||
signature != NULL) {
|
signature != NULL) {
|
||||||
|
#ifdef HAVE_LIBCURL_7_56_0
|
||||||
curl_mimepart *part;
|
curl_mimepart *part;
|
||||||
helper->mime = curl_mime_init (helper->curl);
|
helper->mime = curl_mime_init (helper->curl);
|
||||||
curl_easy_setopt (helper->curl, CURLOPT_MIMEPOST, helper->mime);
|
curl_easy_setopt (helper->curl, CURLOPT_MIMEPOST, helper->mime);
|
||||||
@ -4274,6 +4279,13 @@ fwupd_client_upload_bytes_async (FwupdClient *self,
|
|||||||
curl_mime_data (part, signature, CURL_ZERO_TERMINATED);
|
curl_mime_data (part, signature, CURL_ZERO_TERMINATED);
|
||||||
curl_mime_name (part, "signature");
|
curl_mime_name (part, "signature");
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
g_task_return_new_error (task,
|
||||||
|
FWUPD_ERROR,
|
||||||
|
FWUPD_ERROR_INTERNAL,
|
||||||
|
"not supported as libcurl is too old");
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
helper->headers = curl_slist_append (helper->headers, "Content-Type: text/plain");
|
helper->headers = curl_slist_append (helper->headers, "Content-Type: text/plain");
|
||||||
curl_easy_setopt (helper->curl, CURLOPT_HTTPHEADER, helper->headers);
|
curl_easy_setopt (helper->curl, CURLOPT_HTTPHEADER, helper->headers);
|
||||||
|
@ -213,7 +213,10 @@ endif
|
|||||||
libjcat = dependency('jcat', version : '>= 0.1.0', fallback : ['libjcat', 'libjcat_dep'])
|
libjcat = dependency('jcat', version : '>= 0.1.0', fallback : ['libjcat', 'libjcat_dep'])
|
||||||
libjsonglib = dependency('json-glib-1.0', version : '>= 1.1.1')
|
libjsonglib = dependency('json-glib-1.0', version : '>= 1.1.1')
|
||||||
valgrind = dependency('valgrind', required: false)
|
valgrind = dependency('valgrind', required: false)
|
||||||
libcurl = dependency('libcurl', version : '>= 7.61.0')
|
libcurl = dependency('libcurl', version : '>= 7.47.0')
|
||||||
|
if libcurl.version().version_compare('>= 7.56.0')
|
||||||
|
conf.set('HAVE_LIBCURL_7_56_0', '1')
|
||||||
|
endif
|
||||||
if libcurl.version().version_compare('>= 7.62.0')
|
if libcurl.version().version_compare('>= 7.62.0')
|
||||||
conf.set('HAVE_LIBCURL_7_62_0', '1')
|
conf.set('HAVE_LIBCURL_7_62_0', '1')
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user