valeriyvdovin / rpms / systemd

Forked from rpms/systemd 4 years ago
Clone

Blame SOURCES/0323-import-use-the-old-curl-api.patch

1abbee
From 575f559bcd992d7fd2d7d46b695b7f42923b4463 Mon Sep 17 00:00:00 2001
1abbee
From: Lukas Nykryn <lnykryn@redhat.com>
1abbee
Date: Wed, 6 Apr 2016 15:39:09 +0200
1abbee
Subject: [PATCH] import: use the old curl api
1abbee
1abbee
libcurl in rhel does not have CURLOPT_XFERINFO* symbols, so lets use the
1abbee
old interface.
1abbee
1abbee
RHEL-only
1abbee
Resolves: #1284974
1abbee
---
1abbee
 src/import/import-job.c | 6 +++---
1abbee
 1 file changed, 3 insertions(+), 3 deletions(-)
1abbee
1abbee
diff --git a/src/import/import-job.c b/src/import/import-job.c
1abbee
index 8094865..5f9cfd3 100644
1abbee
--- a/src/import/import-job.c
1abbee
+++ b/src/import/import-job.c
1abbee
@@ -587,7 +587,7 @@ fail:
1abbee
         return 0;
1abbee
 }
1abbee
 
1abbee
-static int import_job_progress_callback(void *userdata, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow) {
1abbee
+static int import_job_progress_callback(void *userdata, double dltotal, double dlnow, double ultotal, double ulnow) {
1abbee
         ImportJob *j = userdata;
1abbee
         unsigned percent;
1abbee
         usec_t n;
1abbee
@@ -714,10 +714,10 @@ int import_job_begin(ImportJob *j) {
1abbee
         if (curl_easy_setopt(j->curl, CURLOPT_HEADERDATA, j) != CURLE_OK)
1abbee
                 return -EIO;
1abbee
 
1abbee
-        if (curl_easy_setopt(j->curl, CURLOPT_XFERINFOFUNCTION, import_job_progress_callback) != CURLE_OK)
1abbee
+        if (curl_easy_setopt(j->curl, CURLOPT_PROGRESSFUNCTION, import_job_progress_callback) != CURLE_OK)
1abbee
                 return -EIO;
1abbee
 
1abbee
-        if (curl_easy_setopt(j->curl, CURLOPT_XFERINFODATA, j) != CURLE_OK)
1abbee
+        if (curl_easy_setopt(j->curl, CURLOPT_PROGRESSDATA, j) != CURLE_OK)
1abbee
                 return -EIO;
1abbee
 
1abbee
         if (curl_easy_setopt(j->curl, CURLOPT_NOPROGRESS, 0) != CURLE_OK)