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

Re: [PATCH] Add unix domain socket support to HTTP transport.

From
EWEric Wong <e@80x24.org>
Date
Feb 21, 2024, 22:09 UTC
Message-ID
<20240221220945.M686016@dcvr>
In-Reply-To
<pull.1681.git.git.1708506863243.gitgitgadget@gmail.com>
Leslie Cheng via GitGitGadget <gitgitgadget@gmail.com> wrote:
> Subject: Re: [PATCH] Add unix domain socket support to HTTP transport.
No need for trailing `.' in commit message titles
<snip>
Show 17 quoted lines
> @@ -455,6 +458,20 @@ static int http_options(const char *var, const char *value,
>  		return 0;
>  	}
>  
> +	if (!strcmp("http.unixsocket", var)) {
> +#ifdef GIT_CURL_HAVE_CURLOPT_UNIX_SOCKET_PATH
> +#ifndef NO_UNIX_SOCKETS
> +		return git_config_string(&curl_unix_socket_path, var, value);
> +#else
> +		warning(_("Unix socket support unavailable in this build of Git"));
> +		return 0;
> +#endif
> +#else
> +		warning(_("Unix socket support is not supported with cURL < 7.40.0"));
> +		return 0;
> +#endif
> +	}

Personally, I'd hoist the #ifdef part into a standalone function since I find mixing CPP and C conditionals confusing.

disclaimer: I'm an easily confused person and don't usually program in C, though.

<snip>
> --- /dev/null
> +++ b/t/t5565-http-unix-domain-socket.sh
<snip>
> +    nc -klU "$socket_path" <tcp_to_uds >uds_to_tcp &
> +    UDS_PID=$!
> +
> +    nc "$host" "$port" >tcp_to_uds <uds_to_tcp &

`nc' isn't widely installed, its supported flags vary between implementations, and our test suite doesn't currently use it. I suggest either using a small bit of Perl or writing a t/helper program to do its job.

Finally, hard tabs should be used for indentation throughout.

I'll wait on others to comment since I haven't looked at git hacking in a while.

Anyways, I think this feature could be useful for me, too :> Thanks.

Previous: Leslie Cheng via GitGitGadgetNext: Leslie Cheng
Message 2 of 7 in “Add unix domain socket support to HTTP transport.”
  1. Add unix domain socket support to HTTP transport.Leslie Cheng via GitGitGadget, Feb 21, 2024
  2. Eric WongFeb 21, 2024
  3. Leslie ChengFeb 22, 2024
  4. Add unix domain socket support to HTTP transportLeslie Cheng via GitGitGadget, Feb 23, 2024
  5. Junio C HamanoFeb 23, 2024
  6. Junio C HamanoFeb 23, 2024
  7. Leslie ChengFeb 23, 2024

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.