curl icon indicating copy to clipboard operation
curl copied to clipboard

Expose curl's url parsing

Open hadley opened this issue 3 years ago • 9 comments
trafficstars

By calling curl_url(), then curl_url_set(), then retrieving the components with curl_url_get().

hadley avatar Apr 26 '22 16:04 hadley

We could do it but a problem is that this API was introduced relatively recently, in libcurl 7.62.0. So we would need a fallback for older linux systems, including ubuntu-18.04 (which is the CI default): https://packages.ubuntu.com/bionic/libcurl4-openssl-dev

jeroen avatar Apr 26 '22 16:04 jeroen

Ah darn it 😞

hadley avatar Apr 26 '22 20:04 hadley

Guess you still need a fallback but FWIW 18.04 Ubuntu is now in extended support mode, Cent OS 7 is EOL, and Debian buster (which I think is also past LTS) is at 7.64 anyway.

TimTaylor avatar Aug 16 '24 13:08 TimTaylor

Sadly the version of libcurl in RHEL-8 is also too old :/ But we could still do it and provide a fallback.

jeroen avatar Aug 16 '24 14:08 jeroen

Sadly the version of libcurl in RHEL-8 is also too old :/ But we coudl do it and provide a fallback.

poop. Forgot to look at that obvious big one :(

TimTaylor avatar Aug 16 '24 14:08 TimTaylor

Yeah it's really unfortunate, I also would like to use the new option-list API unconditinoally but this requires libcurl 7.73 irc so we have to keep providing the fallbacks.

jeroen avatar Aug 16 '24 14:08 jeroen

Would it be possible to vendor in the url parsing code for older libcurl? Or is it too entangled with the rest of the code base?

hadley avatar Aug 16 '24 15:08 hadley

As trurl is a thing I wonder if it would make more sense to have it as a similarly separate package and bring it in to curl with "suggests" for the time being?

TimTaylor avatar Aug 16 '24 15:08 TimTaylor

It is pretty entangled, importing lots of the internal libcurl headers: https://github.com/curl/curl/blob/HEAD/lib/urlapi.c#L848

jeroen avatar Aug 16 '24 15:08 jeroen