From: Michael Tremer Date: Wed, 9 Oct 2024 13:38:26 +0000 (+0000) Subject: xfer: Support compiling with older versions of cURL X-Git-Tag: 0.9.30~1116 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7f1b7cd5632bd1e07fdc214027cf55ea8daf33a8;p=pakfire.git xfer: Support compiling with older versions of cURL Signed-off-by: Michael Tremer --- 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);