From: Eric Wong Date: Wed, 21 Feb 2024 22:09:45 GMT Subject: Re: [PATCH] Add unix domain socket support to HTTP transport. Message-ID: <20240221220945.M686016@dcvr> In-Reply-To: Leslie Cheng via GitGitGadget wrote: > Subject: Re: [PATCH] Add unix domain socket support to HTTP transport. No need for trailing `.' in commit message titles > @@ -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. > --- /dev/null > +++ b/t/t5565-http-unix-domain-socket.sh > + nc -klU "$socket_path" uds_to_tcp & > + UDS_PID=$! > + > + nc "$host" "$port" >tcp_to_uds Thanks.