From 7f1b7cd5632bd1e07fdc214027cf55ea8daf33a8 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Wed, 9 Oct 2024 13:38:26 +0000 Subject: [PATCH] xfer: Support compiling with older versions of cURL Signed-off-by: Michael Tremer --- src/libpakfire/xfer.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libpakfire/xfer.c b/src/libpakfire/xfer.c index c9de59b94..debcd0ee9 100644 --- a/src/libpakfire/xfer.c +++ b/src/libpakfire/xfer.c @@ -285,7 +285,12 @@ static int pakfire_xfer_setup(struct pakfire_xfer* xfer) { goto ERROR; // Limit protocols to HTTPS, HTTP, FTP, FILE and WebSocket over TLS +#ifdef CURLOPT_PROTOCOLS_STR curl_easy_setopt(xfer->handle, CURLOPT_PROTOCOLS_STR, "HTTPS,HTTP,FTP,FILE,WSS"); +#else + curl_easy_setopt(xfer->handle, CURLOPT_PROTOCOLS, + CURLPROTO_HTTP|CURLPROTO_HTTPS|CURLPROTO_FTP|CURLPROTO_FILE); +#endif // Raise any HTTP errors r = curl_easy_setopt(xfer->handle, CURLOPT_FAILONERROR, 1L); -- 2.47.3