{"thread":{"id":"29920","subject":"[PATCH v4 1/5] http: try http_proxy env var when http.proxy config option is not set","startedAt":"2012-03-12T17:25:52Z","lastAt":"2012-03-12T17:25:52Z","messageCount":1,"participants":["Nelson Benitez Leon"],"isPatch":true,"patchVersion":4,"patchTotal":5},"messages":[{"id":"186732","messageId":"4F5E31A0.1000503@seap.minhap.es","threadId":"29920","inReplyTo":null,"subject":"[PATCH v4 1/5] http: try http_proxy env var when http.proxy config option is not set","fromName":"Nelson Benitez Leon","fromEmail":"nelsonjesus.benitez@seap.minhap.es","sentAt":"2012-03-12T17:25:52Z","receivedAt":"2012-03-12T17:25:52Z","isPatch":true,"sender":{"key":"nelsonjesus.benitez@seap.minhap.es","avatar":null},"body":"cURL already reads it, but if $http_proxy has username but no password\ncURL will not ask you for the password and so failed to authenticate\nreturning a 407 error code. So we read it ourselves to detect that and\nask for the password. Also we read it prior to connection to be able to\nmake a proactive authentication in case the flag http_proactive_auth is\nset.\n\nSigned-off-by: Nelson Benitez Leon <nbenitezl@gmail.com>\n---\n http.c |    7 +++++++\n 1 files changed, 7 insertions(+), 0 deletions(-)\n\ndiff --git a/http.c b/http.c\nindex 8ac8eb6..8932da5 100644\n--- a/http.c\n+++ b/http.c\n@@ -295,6 +295,13 @@ static CURL *get_curl_handle(void)\n \tif (curl_ftp_no_epsv)\n \t\tcurl_easy_setopt(result, CURLOPT_FTP_USE_EPSV, 0);\n \n+\tif (!curl_http_proxy) {\n+\t\tconst char *env_proxy;\n+\t\tenv_proxy = getenv(\"http_proxy\");\n+\t\tif (env_proxy) {\n+\t\t\tcurl_http_proxy = xstrdup(env_proxy);\n+\t\t}\n+\t}\n \tif (curl_http_proxy) {\n \t\tcurl_easy_setopt(result, CURLOPT_PROXY, curl_http_proxy);\n \t\tcurl_easy_setopt(result, CURLOPT_PROXYAUTH, CURLAUTH_ANY);\n-- \n1.7.7.6\n"}]}