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

Re: [PATCH 2/6] remote-http(s): Support SOCKS proxies

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 26, 2015, 20:15 UTC
Message-ID
<xmqq7fm9gze2.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<bf218d020e24216f55d1514c4459e645b13ec075.1445865176.git.johannes.schindelin@gmx.de>
Johannes Schindelin <johannes.schindelin@gmx.de> writes:
Show 5 quoted lines
> This patch was required to work behind a faulty AP and scraped from
> http://stackoverflow.com/questions/15227130/#15228479 and guarded with
> an appropriate cURL version check by Johannes Schindelin.
>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Thanks.

The code looks OK but the last paragraph makes _us_ worried. What is the licensing status of the original at SO? I can see that you are taking legal responsibility with the Signed-off-by: line; you state that to the best of your knowledge the patch is covered under an appropriate open source license and you ahve the right under that license to submit it here to the project.

But it is my job to double check when in doubt, hence this question.
Show 26 quoted lines
> ---
>  http.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/http.c b/http.c
> index 7da76ed..6b89dea 100644
> --- a/http.c
> +++ b/http.c
> @@ -465,6 +465,17 @@ static CURL *get_curl_handle(void)
>  
>  	if (curl_http_proxy) {
>  		curl_easy_setopt(result, CURLOPT_PROXY, curl_http_proxy);
> +#if LIBCURL_VERSION_NUM >= 0x071800
> +		if (starts_with(curl_http_proxy, "socks5"))
> +			curl_easy_setopt(result,
> +				CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
> +		else if (starts_with(curl_http_proxy, "socks4a"))
> +			curl_easy_setopt(result,
> +				CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4A);
> +		else if (starts_with(curl_http_proxy, "socks"))
> +			curl_easy_setopt(result,
> +				CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);
> +#endif
>  	}
>  #if LIBCURL_VERSION_NUM >= 0x070a07
>  	curl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
Previous: Johannes SchindelinNext: James McCoy
Message 5 of 48 in “Miscellaneous platform-independent patches from Git for Windows”
  1. 0/6 Miscellaneous platform-independent patches from Git for WindowsJohannes Schindelin, Oct 26, 2015
  2. 1/6 Only use CURLOPT_LOGIN_OPTIONS if it is actually availableJohannes Schindelin, Oct 26, 2015
  3. Junio C HamanoOct 26, 2015
  4. 2/6 remote-http(s): Support SOCKS proxiesJohannes Schindelin, Oct 26, 2015
  5. Junio C HamanoOct 26, 2015
  6. James McCoyOct 27, 2015
  7. Junio C HamanoOct 27, 2015
  8. Johannes SchindelinOct 27, 2015
  9. Johannes SchindelinOct 27, 2015
  10. Junio C HamanoOct 27, 2015
  11. Junio C HamanoOct 27, 2015
  12. Junio C HamanoOct 27, 2015
  13. Johannes SchindelinOct 30, 2015
  14. Pat ThoytsNov 9, 2015
  15. Johannes SchindelinNov 16, 2015
  16. Junio C HamanoNov 18, 2015
  17. 3/6 Facilitate debugging Git executables in tests with gdbJohannes Schindelin, Oct 26, 2015
  18. Jonathan NiederOct 26, 2015
  19. Johannes SchindelinOct 27, 2015
  20. Junio C HamanoOct 27, 2015
  21. Jeff KingOct 27, 2015
  22. Stefan BellerOct 27, 2015
  23. Jeff KingOct 27, 2015
  24. Johannes SchindelinOct 30, 2015
  25. Jeff KingOct 30, 2015
  26. Johannes SchindelinOct 30, 2015
  27. Junio C HamanoOct 30, 2015
  28. Jonathan NiederOct 30, 2015
  29. Johannes SchindelinOct 30, 2015
  30. Jeff KingOct 30, 2015
  31. Jonathan NiederOct 30, 2015
  32. Junio C HamanoOct 30, 2015
  33. Johannes SchindelinOct 30, 2015
  34. Jonathan NiederOct 30, 2015
  35. Duy NguyenOct 27, 2015
  36. Junio C HamanoOct 29, 2015
  37. Victor LeschukOct 29, 2015
  38. Johannes SchindelinOct 30, 2015
  39. Victor LeschukNov 1, 2015
  40. Johannes SchindelinNov 1, 2015
  41. 4/6 Squelch warning about an integer overflowJohannes Schindelin, Oct 26, 2015
  42. Junio C HamanoOct 26, 2015
  43. Johannes SchindelinOct 30, 2015
  44. Junio C HamanoOct 30, 2015
  45. 5/6 Silence GCC's "cast of pointer to integer of a different size" warningJohannes Schindelin, Oct 26, 2015
  46. Junio C HamanoOct 26, 2015
  47. 6/6 Correct fscanf formatting string for I64u valuesJohannes Schindelin, Oct 26, 2015
  48. Junio C HamanoOct 26, 2015

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.