Re: [PATCH 1/6] http: try http_proxy env var when http.proxy config option is not set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Nelson Benitez Leon <nelsonjesus.benitez@xxxxxxxxxxxxxx> writes:

> cURL already reads it, but if $http_proxy has username but no password
> cURL will not ask you for the password and so failed to authenticate
> returning a 407 error code. So we read it ourselves to detect that and
> ask for the password. Also we read it prior to connection to be able to
> make a proactive authentication in case the flag http_proactive_auth is
> set.
>
> We also take care to read env proxy var according to protocol being
> used in the destination url, e.g.  when the url to retrieve is a https
> one, then the proxy env var we look at is https_proxy. We also look at
> the uppercase version of these if the lowercase is not found, with the
> exception of HTTP_PROXY because cURL ignores it. To make this possible
> we now passed destination url parameter to get_active_slot() and
> get_curl_handle() functions.
>
> We also read no_proxy env var so to ignore aforementioned proxy env var
> if no_proxy contains an asterisk ('*') or contains the host used in url
> destination.
>
> Signed-off-by: Nelson Benitez Leon <nbenitezl@xxxxxxxxx>
> Signed-off-by: Junio C Hamano <gitster@xxxxxxxxx>

I'll trust Peff to point out anything I missed, but from a cursory look,
the result looks much cleaner than the previous round.

> diff --git a/http.c b/http.c
> index 5cb87f1..64df7b1 100644
> --- a/http.c
> +++ b/http.c
> @@ -229,6 +229,37 @@ static void init_curl_http_auth(CURL *result)
> ...
> +static int host_allowed_by_noproxy_env (const char *host)
> +{

I'll queue the updated series with s/_env (/_env(/; here, and also add a
missing explanation on the bulk of "noise" in the patch at the end of the
log message:

    In order to be able to determine what proxy settings is needed from
    the very beginning of a request, get_active_slot() learns to take the
    destination URL, as it needs to pass it to get_curl_handle() that
    implements the logic to pick proxies based on the protocol used.


Thanks.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Newbies FAQ]     [Linux Kernel Development]     [Free Online Dating]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Free Online Dating]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]     [Linux Resources]

Add to Google