All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org,
	"Carlo Marcelo Arenas Belón" <carenas@gmail.com>,
	"Johannes Schindelin" <johannes.schindelin@gmx.de>,
	"Junio C Hamano" <gitster@pobox.com>
Subject: Re: [PATCH v2 1/1] remote-curl: unbreak http.extraHeader with custom allocators
Date: Wed, 6 Nov 2019 06:29:01 -0500	[thread overview]
Message-ID: <20191106112901.GA25966@sigill.intra.peff.net> (raw)
In-Reply-To: <3168ba2c9eadcf0cd7e4f2533c9306b5d2c627d0.1573034695.git.gitgitgadget@gmail.com>

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

  reply	other threads:[~2019-11-06 11:29 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-05 21:59 [PATCH 0/1] remote-curl: unbreak http.extraHeader with custom allocators Johannes Schindelin via GitGitGadget
2019-11-05 21:59 ` [PATCH 1/1] " Johannes Schindelin via GitGitGadget
2019-11-06  4:16   ` Jeff King
2019-11-06  9:14     ` Johannes Schindelin
2019-11-06  9:49       ` Junio C Hamano
2019-11-06 19:38         ` Johannes Schindelin
2019-11-08  8:34           ` Junio C Hamano
2019-11-08 13:44             ` Johannes Schindelin
2019-11-06 10:04 ` [PATCH v2 0/1] " Johannes Schindelin via GitGitGadget
2019-11-06 10:04   ` [PATCH v2 1/1] " Johannes Schindelin via GitGitGadget
2019-11-06 11:29     ` Jeff King [this message]
2019-11-06 12:12     ` Junio C Hamano
2019-11-06 19:34       ` Johannes Schindelin
2019-11-07  5:39         ` Junio C Hamano
2019-11-07 12:40           ` Johannes Schindelin
2019-11-08  3:03             ` Junio C Hamano
2019-11-06 12:15   ` [PATCH v2 0/1] " Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191106112901.GA25966@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=carenas@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=gitster@pobox.com \
    --cc=johannes.schindelin@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.