supabase / pg_net

A PostgreSQL extension that enables asynchronous (non-blocking) HTTP/HTTPS requests with SQL
https://supabase.github.io/pg_net
Apache License 2.0
213 stars 16 forks source link

feat: use CURLOPT_PROTOCOLS_STR with libcurl >= 7.85.0 #128

Closed marsam closed 6 months ago

marsam commented 6 months ago

What kind of change does this PR introduce?

Replace deprecated libcurl symbols

What is the current behavior?

pg_net is using CURLOPT_PROTOCOLS which was deprecated in libcurl 7.85.0, causing build error:

src/worker.c: In function 'init':
src/worker.c:153:9: error: 'CURLOPT_PROTOCOLS' is deprecated: since 7.85.0. Use CURLOPT_PROTOCOLS_STR [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wdeprecated-declarations-Werror=deprecated-declarations8;;]
  153 |         curl_easy_setopt(eh, CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS);
      |         ^~~~~~~~~~~~~~~~
In file included from src/worker.c:30:
/nix/store/3k4czsnh3wg9liji56v4kjdz3p1mxhsj-curl-8.6.0-dev/include/curl/curl.h:1745:3: note: declared here
 1745 |   CURLOPTDEPRECATED(CURLOPT_PROTOCOLS, CURLOPTTYPE_LONG, 181,
      |   ^~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

What is the new behavior?

pg_net builds correctly with libcurl >=7.85.0

Additional context

Add any other context or screenshots.

steve-chavez commented 6 months ago

@marsam Many thanks for the contrib!