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: Strange connection persistence problem

From: Max via curl-library <>
Date: Thu, 30 Nov 2023 18:00:44 +0100

Thank you Daniel.

I am using libcurl-7.85.0-12.fc37.x86_64

It is odd that if I do (down in my code) one after the other:
  curl_easy_setopt(curl, CURLOPT_URL, _URL);
then printf outputs the correct url content but the following
curl_easy_setopt does not work.

I noticed that due to some compiler optimization _URL although changed
in content is kept starting at the same initial memory address.

Moreover, if you have noticed, the header Host field is correct but the
GET location is not.

Are you checking the _URL memory address (pointer) somewhere in the
library code developing curl_easy_setopt(curl, CURLOPT_URL, _URL)?

Maybe there is some kind of optimization based on the memory address of

I have no better ideas!

Thanks for any clue.

On 11/30/23 16:21, Daniel Stenberg wrote:
> On Thu, 30 Nov 2023, Max via curl-library wrote:
>> The following (problematic) step is
>> GET
>> *   Trying NNN.NNN.NNN.191:443...      <<< mapped to different IP
>> * Connected to (NNN.NNN.NNN.191) port 443 (#3)
>> ...
>>> GET  /v1/pub/auth/web/login?scd=true HTTP/1.1
>> Host:
>> How comes my GET goes to the previous URL (that of the POST) and not
>> my new URL?
> Wow. That certainly looks wrong and I have no explanations as to why or
> how that can happen. I have never seen anything like that.
> This is going to be really hard to do anything about without an example
> code that can reproduce the symptoms. If you write something basic doing
> the same logical set of requests + methods in a similar series, can you
> make the problem happen?
> Is this using a modern libcurl version?
Received on 2023-11-30