[Bug,debuginfod/29926] debuginfod using deprecated curl (since 7.55.0) API, fails to build with 7.87.0

Message ID bug-29926-10460-dm9TEWhw9D@http.sourceware.org/bugzilla/
State Committed
Headers
Series [Bug,debuginfod/29926] debuginfod using deprecated curl (since 7.55.0) API, fails to build with 7.87.0 |

Commit Message

dodji at seketeli dot org Jan. 10, 2023, 10:23 p.m. UTC
  https://sourceware.org/bugzilla/show_bug.cgi?id=29926

Mark Wielaard <mark at klomp dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|FIXED                       |---
                 CC|                            |mark at klomp dot org
   Last reconfirmed|                            |2023-01-10
             Status|RESOLVED                    |REOPENED
     Ever confirmed|0                           |1

--- Comment #4 from Mark Wielaard <mark at klomp dot org> ---
Does the following work for you?


https://code.wildebeest.org/git/user/mjw/elfutils/commit/?h=protocols_str
  

Patch

diff --git a/debuginfod/debuginfod-client.c b/debuginfod/debuginfod-client.c
index a16165bd..1ce45632 100644
--- a/debuginfod/debuginfod-client.c
+++ b/debuginfod/debuginfod-client.c
@@ -1336,8 +1336,13 @@  debuginfod_query_server (debuginfod_client *c,

       /* Only allow http:// + https:// + file:// so we aren't being
         redirected to some unsupported protocol.  */
+#if CURL_AT_LEAST_VERSION(7, 85, 0)
+      curl_easy_setopt_ck(data[i].handle, CURLOPT_PROTOCOLS_STR,
+                         "http,https,file");
+#else
       curl_easy_setopt_ck(data[i].handle, CURLOPT_PROTOCOLS,
                          (CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_FILE));
+#endif
       curl_easy_setopt_ck(data[i].handle, CURLOPT_URL, data[i].url);
       if (vfd >= 0)
        curl_easy_setopt_ck(data[i].handle, CURLOPT_ERRORBUFFER,