]> git.ipfire.org Git - pakfire.git/commitdiff
xfer: Support compiling with older versions of cURL
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 9 Oct 2024 13:38:26 +0000 (13:38 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 9 Oct 2024 15:13:52 +0000 (15:13 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/xfer.c

index c9de59b94560e2684afdbcf48f7988369fa2f3f7..debcd0ee9785bafeb4d48d6324494088471b44ec 100644 (file)
@@ -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);