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.

data->set and some recent cleanups

From: Daniel Stenberg via curl-library <curl-library_at_cool.haxx.se>
Date: Tue, 9 Feb 2021 10:38:42 +0100 (CET)

Hi team,

Over the last few days I've done some minor libcurl code cleanups that I
figured could be worth putting some light on for you all.

All struct fields in 'struct UserDefined' within the easy handle MUST NOT be
updated or changed at run-time by code. It is important that the values in
there remain as set by the user. This, because when a handle is reused for
subsequent transfers, they should start off with the same settings as the
previous transfer did! (These are found in the code as data->set.[field].)

Code that need to update or change a value in run-time need to clone that
value in the 'UrlState' struct and init the value at the start of transfers,
perhaps best done in Curl_pretransfer. These state fields are found as
'data->state.[field]' in the code.

Example PR in progress fixing such previous mistakes:
https://github.com/curl/curl/pull/6578


-- 
  / 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-09