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

Re: [PATCH 2/3] http: try standard proxy env vars when http.proxy config option is not set

From
NLNelson Benitez Leon <nelsonjesus.benitez@seap.minhap.es>
Date
Mar 1, 2012, 09:57 UTC
Message-ID
<4F4F47EF.40405@seap.minhap.es>
In-Reply-To
<20120229210816.GB628@sigill.intra.peff.net>
On 02/29/2012 10:08 PM, Jeff King wrote:
Show 16 quoted lines
> On Wed, Feb 29, 2012 at 11:46:03AM +0100, Nelson Benitez Leon wrote:
> 
>>> Good point. We sometimes follow this order:
>>>
>>>   1. git-specific environment variables (i.e., $GIT_HTTP_PROXY, if
>>>      it existed)
>>>   2. git config files (i.e., http.proxy)
>>>   3. generic system environment (i.e., $http_proxy).
>>>
>>> So thinking about it that way, the original patch makes more sense.
>>
>> So, in PATCH 2/3, apart from expanding the commit message.. do we want
>> to support HTTP_PROXY or only http_proxy ? HTTP_PROXY seems to not be
>> very used by existent programs, but support it it's only a gentenv call..
> 
> If HTTP_PROXY is not in wide use, I don't see a reason to support it.
Ok
Show 6 quoted lines
> And I take back what I said about environment precedence, based on the
> discussion. Also, I don't think there is a need to strdup the results of
> getenv here, is there? So I think the code you want is just:
> 
>   if (!curl_http_proxy)
>           curl_http_proxy = getenv("http_proxy");
but curl_http_proxy gets freed in http_cleanup as follows:
free((void *)curl_http_proxy);

Is it ok to free strings returned by getenv() ? I thought nope, so I used strdup which existent code was already using..

Show 10 quoted lines
> 
> and the justification for the commit message is that we need to know the
> proxy value outside of curl, because the next patch will do some
> extra processing on the value.
> 
> -Peff
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous: Jeff KingNext: Jeff King
Message 16 of 24 in “http: try standard proxy env vars when http.proxy config option is not set”
  1. 2/3 http: try standard proxy env vars when http.proxy config option is not setNelson Benitez Leon, Feb 28, 2012
  2. Thomas RastFeb 28, 2012
  3. Nelson Benitez LeonFeb 28, 2012
  4. Thomas RastFeb 28, 2012
  5. Junio C HamanoFeb 28, 2012
  6. Nelson Benitez LeonFeb 29, 2012
  7. Junio C HamanoFeb 29, 2012
  8. Nelson Benitez LeonMar 1, 2012
  9. Daniel StenbergMar 4, 2012
  10. Jeff KingFeb 28, 2012
  11. Sam VilainFeb 28, 2012
  12. Jeff KingFeb 28, 2012
  13. Matthieu MoyFeb 29, 2012
  14. Nelson Benitez LeonFeb 29, 2012
  15. Jeff KingFeb 29, 2012
  16. Nelson Benitez LeonMar 1, 2012
  17. Jeff KingMar 1, 2012
  18. James CloosMar 11, 2012
  19. Junio C HamanoMar 11, 2012
  20. Nelson Benitez LeonMar 13, 2012
  21. Junio C HamanoMar 14, 2012
  22. Nelson Benitez LeonMar 14, 2012
  23. Junio C HamanoMar 14, 2012
  24. Nelson Benitez LeonMar 15, 2012

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.