From: Jonathan Tan Date: Wed, 10 Jan 2018 00:10:30 GMT Subject: Re: [PATCH 26/26] remote-curl: implement connect-half-duplex command Message-ID: <20180109161030.e04f0a8d21eb1bdb0f626a83@google.com> In-Reply-To: <20180103001828.205012-27-bmwill@google.com> On Tue, 2 Jan 2018 16:18:28 -0800 Brandon Williams wrote: > Teach remote-curl the 'connect-half-duplex' command which is used to > establish a half-duplex connection with servers which support protocol > version 2. This allows remote-curl to act as a proxy, allowing the git > client to communicate natively with a remote end, simply using > remote-curl as a pass through to convert requests to http. > > Signed-off-by: Brandon Williams > --- > remote-curl.c | 185 ++++++++++++++++++++++++++++++++++++++++++++++++- > t/t5701-protocol-v2.sh | 41 +++++++++++ > 2 files changed, 224 insertions(+), 2 deletions(-) I didn't look at the usage of the curl API in detail, but overall this looks good. I'm pleasantly surprised that it didn't take so many lines of code as I expected. Overall everything looks good, except for the points that I have brought up in my other e-mails. > diff --git a/remote-curl.c b/remote-curl.c > index 4086aa733..b63b06398 100644 > --- a/remote-curl.c > +++ b/remote-curl.c [snip] > +struct proxy_state { > + char *service_name; > + char *service_url; > + char *hdr_content_type; > + char *hdr_accept; Maybe document that the above 3 fields (service_url to hdr_accept) are cached because we need to pass them to curl_easy_setopt() for every request.