Re: [PATCH 1/2] http: allow selection of proxy authentication method

2015-11-04 Thread Junio C Hamano
Knut Franke writes: > diff --git a/http.c b/http.c > index 7da76ed..a786802 100644 > --- a/http.c > +++ b/http.c > @@ -305,6 +326,40 @@ static void init_curl_http_auth(CURL *result) > #endif > } > > +/* assumes *var is free-able */ This is not just "assumes", but it is wrong for the callers

[PATCH 1/2] http: allow selection of proxy authentication method

2015-11-04 Thread Knut Franke
CURLAUTH_ANY does not work with proxies which answer unauthenticated requests with a 307 redirect to an error page instead of a 407 listing supported authentication methods. Therefore, allow the authentication method to be set using the environment variable GIT_HTTP_PROXY_AUTHMETHOD or configuratio

Re: [PATCH 1/2] http: allow selection of proxy authentication method

2015-11-03 Thread Junio C Hamano
Knut Franke writes: > On 2015-11-02 14:46, Junio C Hamano wrote: >> > Reviewed-by: Junio C Hamano >> > Reviewed-by: Eric Sunshine >> >> Please add these only when you are doing the final submission, >> sending the same version reviewed by these people after they said >> the patch(es) look good

Re: [PATCH 1/2] http: allow selection of proxy authentication method

2015-11-03 Thread Knut Franke
On 2015-11-02 14:46, Junio C Hamano wrote: > > Reviewed-by: Junio C Hamano > > Reviewed-by: Eric Sunshine > > Please add these only when you are doing the final submission, > sending the same version reviewed by these people after they said > the patch(es) look good. To credit others for helpin

Re: [PATCH 1/2] http: allow selection of proxy authentication method

2015-11-02 Thread Junio C Hamano
Knut Franke writes: > CURLAUTH_ANY does not work with proxies which answer unauthenticated requests > with a 307 redirect to an error page instead of a 407 listing supported > authentication methods. Therefore, allow the authentication method to be set > using the environment variable GIT_HTTP_PR

[PATCH 1/2] http: allow selection of proxy authentication method

2015-11-02 Thread Knut Franke
CURLAUTH_ANY does not work with proxies which answer unauthenticated requests with a 307 redirect to an error page instead of a 407 listing supported authentication methods. Therefore, allow the authentication method to be set using the environment variable GIT_HTTP_PROXY_AUTHMETHOD or configuratio

Re: [PATCH 1/2] http: allow selection of proxy authentication method

2015-10-30 Thread Junio C Hamano
Knut Franke writes: > Maybe add a #define LIBCURL_CAN_HANDLE_PROXY_AUTH to clarify this, like we do > with LIBCURL_CAN_HANDLE_AUTH_ANY? Quite frankly, my first preference is to have a code that is clear enough so that you do not need such an intermediate macro. By isolating implementation detai

Re: [PATCH 1/2] http: allow selection of proxy authentication method

2015-10-30 Thread Knut Franke
Junio C Hamano wrote: > > + if (http_proxy_authmethod) { > > + int i; > > + for (i = 0; i < ARRAY_SIZE(http_proxy_authmethods); i++) { > > + if (!strcmp(http_proxy_authmethod, > > http_proxy_authmethods[i].name)) { > > + curl_easy_s

Re: [PATCH 1/2] http: allow selection of proxy authentication method

2015-10-28 Thread Eric Sunshine
In addition to Junio's review comments... On Wednesday, October 28, 2015, Knut Franke wrote: > CURLAUTH_ANY does not work with proxies which answer unauthenticated requests > with a 307 redirect to an error page instead of a 407 listing supported > authentication methods. Therefore, allow the aut

Re: [PATCH 1/2] http: allow selection of proxy authentication method

2015-10-28 Thread Junio C Hamano
Junio C Hamano writes: >> +static void copy_from_env(const char **var, const char *envname) >> +{ >> +const char *val = getenv(envname); >> +if (val) >> +*var = xstrdup(val); >> +} >> + >> +static void init_curl_proxy_auth(CURL *result) >> +{ >> +copy_from_env(&http_proxy_

Re: [PATCH 1/2] http: allow selection of proxy authentication method

2015-10-28 Thread Junio C Hamano
Knut Franke writes: > CURLAUTH_ANY does not work with proxies which answer unauthenticated requests > with a 307 redirect to an error page instead of a 407 listing supported > authentication methods. Therefore, allow the authentication method to be set > using the environment variable GIT_HTTP_PR

[PATCH 1/2] http: allow selection of proxy authentication method

2015-10-28 Thread Knut Franke
CURLAUTH_ANY does not work with proxies which answer unauthenticated requests with a 307 redirect to an error page instead of a 407 listing supported authentication methods. Therefore, allow the authentication method to be set using the environment variable GIT_HTTP_PROXY_AUTHMETHOD or configuratio

Re: [PATCH 1/2] http: allow selection of proxy authentication method

2015-10-27 Thread Knut Franke
On 2015-10-26 13:33, Junio C Hamano wrote: > Call yours "http.proxyAuthmethod" in the documentation, and use > strcmp("http.proxyauthmethod", var) in the options callback code. [...] > Strange indentation here... [...] > Along the same line as how we do sslversions[] instead of a long > if/else if/

Re: [PATCH 1/2] http: allow selection of proxy authentication method

2015-10-26 Thread Junio C Hamano
Knut Franke writes: > CURLAUTH_ANY does not work with proxies which answer unauthenticated requests > with a 307 redirect to an error page instead of a 407 listing supported > authentication methods. Therefore, allow the authentication method to be set > using the environment variable GIT_HTTP_PR

[PATCH 1/2] http: allow selection of proxy authentication method

2015-10-26 Thread Knut Franke
CURLAUTH_ANY does not work with proxies which answer unauthenticated requests with a 307 redirect to an error page instead of a 407 listing supported authentication methods. Therefore, allow the authentication method to be set using the environment variable GIT_HTTP_PROXY_AUTHMETHOD or configuratio