curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support. 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 Daniel himself.

Re: How to properly re-use an easy handle having CURLOPT_CONNECT_ONLY=1?

From: Daniel Stenberg via curl-library <curl-library_at_lists.haxx.se>
Date: Tue, 14 Jan 2025 08:07:19 +0100 (CET)

On Tue, 14 Jan 2025, Aleksander Mazur via curl-library wrote:

> The problem is that although everything seems to work (in version 8.9.1),
> valgrind reports massive memory leaks each time the easy handle is re-used
> by curl_easy_perform. On the other hand, if interrupted right after first
> successful connection, memleak report is clear.

As documented in the CURLOPT_CONNECT_ONLY man page which seems relevant since
your example code uses it:

   Transfers marked connect only do not reuse any existing connections and
   connections marked connect only are not allowed to get reused.

> Second time libcurl aborts with: example: url.c:749: Curl_conn_seems_dead:
> Assertion `!data->conn' failed.

That should probably be handled better, but you seem to be using a debug build
and then we sometimes make it do things with asserts like that.

-- 
  / daniel.haxx.se || https://rock-solid.curl.dev
-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2025-01-14