curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: CURLINFO_EFFECTIVE_URL when using CURLOPT_CURLU

From: Adam Light via curl-library <curl-library_at_lists.haxx.se>
Date: Tue, 7 Jun 2022 07:20:32 -0700

On Tue, Jun 7, 2022 at 2:14 AM Daniel Stenberg via curl-library <
curl-library_at_lists.haxx.se> wrote:

> On Mon, 6 Jun 2022, Dan Fandrich via curl-library wrote:
>
> > That sounds like a bug. Setting the URL with or CURLOPT_URL or
> CURLOPT_CURLU
> > shouldn't make any difference to the rest of the library.
>
> In an attempt to reproduce this problem, I created test 1543 but apart
> from me
> having to fix the test suite a little, I could not make the mentioned
> problem appear:
>
> https://github.com/curl/curl/pull/8971
>
>
Hi Daniel. Thanks for taking a look.

One difference I have found with the new version of libcurl is that if you
set the URL with CURLOPT_CURLU, you must call curl_easy_perform() first
before it's possible to use curl_easy_getinfo() to get the URL (before then
you just get an empty string). However if you set the URL with CURLOPT_URL
you can immediately retrieve it by calling curl_easy_getinfo().
The CURLINFO_EFFECTIVE_URL documentation says "...and get the last used
effective URL" so the current behavior might still be "right" based on the
documentation, but there is a difference between CURLOPT_URL and
CURLOPT_CURLU.

I'm happy to submit this as a bug report in Git if you'd like me to. I
don't yet have a MWE but I could come up with one. I just wanted to get
some clarification first about what behavior I should expect since this is
a bit of an edge case.

Thanks
Adam


-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html
Received on 2022-06-07