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: Allocate ssl backend

From: Daniel Stenberg via curl-library <curl-library_at_cool.haxx.se>
Date: Thu, 18 Feb 2021 10:59:29 +0100 (CET)

On Thu, 18 Feb 2021, MichaƂ Antoniak via curl-library wrote:

> https://github.com/curl/curl/blob/e72270236cf7606069907f91e55e02c5ed54df4a/lib/url.c#L1640
>
> Is it intended to allocate memory for ssl backend data 4 times?

Yes. libcurl might use two TLS connections for host and the logic is mostly
cloned for proxies so we have two for that as well, even if an optimization
could remove one of them for proxy.

With OpenSSL, that struct is 32 bytes big on an x86-64 arch so it's not like
we're wasting oceans of data there.

> I briefly checked the code and it seems that gskit.c explicitly uses
> proxy_ssl regardless of the CURL_DISABLE_PROXY flag. Is it intentional?

That probably just shows that nobody has built gskit with CURL_DISABLE_PROXY
or at least not bothered to trim down those things for proxy-less builds.

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


-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.se/mail/etiquette.html
Received on 2021-02-18