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