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.

Strange connection persistence problem

From: Max via curl-library <>
Date: Thu, 30 Nov 2023 15:09:40 +0100


I have been using libcurl for several years without hitting any problem
while reusing my existing connection/curl handle (including a mix of
GETS, POSTS, and changing host).

Now I am stuck with this problem. I do a few connection to a server
(which I do not control), the last two being (for auth purposes):

* Re-using existing connection #2 with host
* Connected to (NNN.NNN.NNN.176) port 443 (#2)
> POST /v1/pub/auth/web/login?scd=true HTTP/1.1
Up to here all is POSTed correctly and an auth reply is obtained.

The following (problematic) step is
* 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

How comes my GET goes to the previous URL (that of the POST) and not my
new URL?

I am using C++ and a custom wrapper and of course I have checked that I
pass a new string (at a new address to)
  curl_easy_setopt(curl, CURLOPT_URL, _URL)
before doing

Thank you very much for any help to get me on the right way.

Received on 2023-11-30