git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 1/1] remote-curl: unbreak http.extraHeader with custom allocators

From
Jeff King <peff@peff.net>
Date
Nov 6, 2019, 11:29 UTC
Message-ID
<20191106112901.GA25966@sigill.intra.peff.net>
In-Reply-To
<3168ba2c9eadcf0cd7e4f2533c9306b5d2c627d0.1573034695.git.gitgitgadget@gmail.com>
On Wed, Nov 06, 2019 at 10:04:55AM +0000, Johannes Schindelin via GitGitGadget wrote:
Show 8 quoted lines
> 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
Previous: Johannes Schindelin via GitGitGadgetNext: Junio C Hamano
Message 11 of 17 in “remote-curl: unbreak http.extraHeader with custom allocators”
  1. 0/1 remote-curl: unbreak http.extraHeader with custom allocatorsJohannes Schindelin via GitGitGadget, Nov 5, 2019
  2. 1/1 remote-curl: unbreak http.extraHeader with custom allocatorsJohannes Schindelin via GitGitGadget, Nov 5, 2019
  3. Jeff KingNov 6, 2019
  4. Johannes SchindelinNov 6, 2019
  5. Junio C HamanoNov 6, 2019
  6. Johannes SchindelinNov 6, 2019
  7. Junio C HamanoNov 8, 2019
  8. Johannes SchindelinNov 8, 2019
  9. 0/1 remote-curl: unbreak http.extraHeader with custom allocatorsJohannes Schindelin via GitGitGadget, Nov 6, 2019
  10. 1/1 remote-curl: unbreak http.extraHeader with custom allocatorsJohannes Schindelin via GitGitGadget, Nov 6, 2019
  11. Jeff KingNov 6, 2019
  12. Junio C HamanoNov 6, 2019
  13. Johannes SchindelinNov 6, 2019
  14. Junio C HamanoNov 7, 2019
  15. Johannes SchindelinNov 7, 2019
  16. Junio C HamanoNov 8, 2019
  17. Junio C HamanoNov 6, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.