On Wed, Nov 06, 2019 at 10:04:55AM +0000, Johannes Schindelin via GitGitGadget wrote: > A naïve attempt at fixing this would move the call to > `curl_global_init()` _before_ the config is parsed (i.e. before that > call to `slist_append()`). > > However, that does work, as we _also_ parse the config setting > `http.sslbackend` and if found, call `curl_global_sslset()` which *must* > be called before `curl_global_init()`, for details see: > https://curl.haxx.se/libcurl/c/curl_global_sslset.html Yikes, good catch. It didn't even occur to me that there might be curl things we had to do _before_ calling curl_global_init(). > So let's instead make the config parsing entirely independent from > cURL's data structures. Incidentally, this deletes two more lines than > it introduces, which is nice. Yes, I actually find the resulting code easier to read. I had feared having to add an extra step to initialize the slist, but it's all handled quite neatly in http_copy_default_headers(). > http.c | 18 ++++++++---------- > 1 file changed, 8 insertions(+), 10 deletions(-) The patch itself looks good to me. -Peff