curl / Mailing Lists / curl-users / 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: How is --parallel handled when --proxy is set ?

From: Daniel Stenberg via curl-users <curl-users_at_lists.haxx.se>
Date: Mon, 29 May 2023 12:14:15 +0200 (CEST)

On Mon, 29 May 2023, Markur Sens wrote:

>> It depends. curl tries to do "as good as possible" in those situations and
>> not close down more connections than it needs to, because it might want to
>> use that connection again for the next transfer.
>
> Any ideas how can I make this “best effort” policy more “transparent” /
> predictable ?

On transparency: the verbose output says if a connection is "left alive" after
a transfer completes. curl is not trying to expose every single little
protocol decision to the user so there might be things not terribly visible
that possibly could be improved.

On predictability: what else can curl do than to follow the protocol? It
should be perfectly predictable given a certain protocol and network behavior.

> Maybe pointer to the source code I can have a look at ?

libcurl is a fairly complicated machinery so you probably need to understand
and look at several pieces of code to get a complete picture of what is going
on, but the specific function that gets called when a transfer is complete
(when it enter the DONE state) is called multi_done:

https://github.com/curl/curl/blob/d53cf9e7339c092c9d54810f3e141de6059c79d4/lib/multi.c#L647

-- 
  / daniel.haxx.se
  | Commercial curl support up to 24x7 is available!
  | Private help, bug fixes, support, ports, new features
  | https://curl.se/support.html


-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-users
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2023-05-29