import: use CURLOPT_PROTOCOLS_STR with libcurl >= 7.85.0
Signed-off-by: zhaoxiaohu <zhaoxiaohu@kuaishou.com>
This commit is contained in:
parent
f1a09f0bca
commit
5c1c3f070b
@ -0,0 +1,56 @@
|
|||||||
|
From bbe1d1e498e62e851d1b93a690a7b80cd7ba4828 Mon Sep 17 00:00:00 2001
|
||||||
|
From: zhaoxiaohu <zhaoxiaohu@kuaishou.com>
|
||||||
|
Date: Mon, 26 Aug 2024 16:05:30 +0800
|
||||||
|
Subject: [PATCH] import: use CURLOPT_PROTOCOLS_STR with libcurl >= 7.85.0
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
CURLOPT_PROTOCOLS [0] was deprecated in libcurl 7.85.0 with
|
||||||
|
CURLOPT_PROTOCOLS_STR [1] as a replacement, causing build warnings/errors:
|
||||||
|
|
||||||
|
../build/src/import/curl-util.c: In function ‘curl_glue_make’:
|
||||||
|
../build/src/import/curl-util.c:255:9: error: ‘CURLOPT_PROTOCOLS’ is deprecated: since 7.85.0. Use CURLOPT_PROTOCOLS_STR [-Werror=deprecated-declarations]
|
||||||
|
255 | if (curl_easy_setopt(c, CURLOPT_PROTOCOLS, CURLPROTO_HTTP|CURLPROTO_HTTPS|CURLPROTO_FILE) != CURLE_OK)
|
||||||
|
| ^~
|
||||||
|
In file included from ../build/src/import/curl-util.h:4,
|
||||||
|
from ../build/src/import/curl-util.c:6:
|
||||||
|
/usr/include/curl/curl.h:1749:3: note: declared here
|
||||||
|
1749 | CURLOPTDEPRECATED(CURLOPT_PROTOCOLS, CURLOPTTYPE_LONG, 181,
|
||||||
|
| ^~~~~~~~~~~~~~~~~
|
||||||
|
cc1: all warnings being treated as errors
|
||||||
|
|
||||||
|
Since there's no grace period between the two symbols, let's resort
|
||||||
|
to a light if-def-ery to resolve this.
|
||||||
|
|
||||||
|
[0] https://curl.se/libcurl/c/CURLOPT_PROTOCOLS.html
|
||||||
|
[1] https://curl.se/libcurl/c/CURLOPT_PROTOCOLS_STR.html
|
||||||
|
|
||||||
|
Reference: https://github.com/systemd/systemd/pull/25982/commits/e61a4c0b7c79eabbe4eb50ff2e663734fde769f0
|
||||||
|
|
||||||
|
Signed-off-by: Frantisek Sumsal <frantisek@sumsal.cz>
|
||||||
|
Signed-off-by: zhaoxiaohu <zhaoxiaohu@kuaishou.com>
|
||||||
|
Signed-off-by: yuwang <yuwang@kuaishou.com>
|
||||||
|
---
|
||||||
|
src/import/curl-util.c | 4 ++++
|
||||||
|
1 file changed, 4 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/src/import/curl-util.c b/src/import/curl-util.c
|
||||||
|
index d6a16b4..24a4fb6 100644
|
||||||
|
--- a/src/import/curl-util.c
|
||||||
|
+++ b/src/import/curl-util.c
|
||||||
|
@@ -256,7 +256,11 @@ int curl_glue_make(CURL **ret, const char *url, void *userdata) {
|
||||||
|
if (curl_easy_setopt(c, CURLOPT_LOW_SPEED_LIMIT, 30L) != CURLE_OK)
|
||||||
|
return -EIO;
|
||||||
|
|
||||||
|
+#if LIBCURL_VERSION_NUM >= 0x075500 /* libcurl 7.85.0 */
|
||||||
|
+ if (curl_easy_setopt(c, CURLOPT_PROTOCOLS_STR, "HTTP,HTTPS,FILE") != CURLE_OK)
|
||||||
|
+#else
|
||||||
|
if (curl_easy_setopt(c, CURLOPT_PROTOCOLS, CURLPROTO_HTTP|CURLPROTO_HTTPS|CURLPROTO_FILE) != CURLE_OK)
|
||||||
|
+#endif
|
||||||
|
return -EIO;
|
||||||
|
|
||||||
|
*ret = TAKE_PTR(c);
|
||||||
|
--
|
||||||
|
2.33.0
|
||||||
|
|
||||||
@ -21,7 +21,7 @@
|
|||||||
Name: systemd
|
Name: systemd
|
||||||
Url: https://systemd.io/
|
Url: https://systemd.io/
|
||||||
Version: 249
|
Version: 249
|
||||||
Release: 86
|
Release: 87
|
||||||
License: MIT and LGPLv2+ and GPLv2+
|
License: MIT and LGPLv2+ and GPLv2+
|
||||||
Summary: System and Service Manager
|
Summary: System and Service Manager
|
||||||
|
|
||||||
@ -678,6 +678,7 @@ Patch6629: backport-seccomp-util-include-missing_syscall_def.h-to-make-__SN
|
|||||||
Patch6630: backport-mount-optimize-mountinfo-traversal-by-decoupling-dev.patch
|
Patch6630: backport-mount-optimize-mountinfo-traversal-by-decoupling-dev.patch
|
||||||
Patch6631: backport-pid1-add-env-var-to-override-default-mount-rate-limit-burst.patch
|
Patch6631: backport-pid1-add-env-var-to-override-default-mount-rate-limit-burst.patch
|
||||||
Patch6632: backport-pid1-add-env-var-to-override-default-mount-rate-limit-interval.patch
|
Patch6632: backport-pid1-add-env-var-to-override-default-mount-rate-limit-interval.patch
|
||||||
|
Patch6633: backport-import-use-CURLOPT_PROTOCOLS_STR-with-libcurl-7.85.0.patch
|
||||||
|
|
||||||
Patch9001: update-rtc-with-system-clock-when-shutdown.patch
|
Patch9001: update-rtc-with-system-clock-when-shutdown.patch
|
||||||
Patch9002: udev-add-actions-while-rename-netif-failed.patch
|
Patch9002: udev-add-actions-while-rename-netif-failed.patch
|
||||||
@ -2192,6 +2193,9 @@ grep -q -E '^KEYMAP="?fi-latin[19]"?' /etc/vconsole.conf 2>/dev/null &&
|
|||||||
/usr/bin/systemd-cryptenroll
|
/usr/bin/systemd-cryptenroll
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Sat Nov 30 2024 zhangyao <zhangyao108@huawei.com> - 249-87
|
||||||
|
- add backport-import-use-CURLOPT_PROTOCOLS_STR-with-libcurl-7.85.0.patch
|
||||||
|
|
||||||
* Mon Nov 11 2024 xujing <xujing125@huawei.com> - 249-86
|
* Mon Nov 11 2024 xujing <xujing125@huawei.com> - 249-86
|
||||||
- pid1: add env var to override default mount rate limit burst and interval
|
- pid1: add env var to override default mount rate limit burst and interval
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user