wget-dev
[Top][All Lists]
Advanced

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

Re: wget2 | Draft: CIDR support added for No Proxy. Testing Code Added (


From: Harshmohan Kulkarni (@harshmohan07)
Subject: Re: wget2 | Draft: CIDR support added for No Proxy. Testing Code Added (!521)
Date: Sun, 09 Apr 2023 12:58:39 +0000



Harshmohan Kulkarni commented on a discussion on libwget/http.c: 
https://gitlab.com/gnuwget/wget2/-/merge_requests/521#note_1346107079

>       return 0;
>  }
>  
> +wget_vector* wget_http_get_no_proxy(void){
> +     return no_proxies;
> +}
> +
> +bool wget_http_cidr_match(const char *cidr, struct in_addr *addr)
> +{
> +     char *slash_pos = strchr(cidr, '/');
> +     if (slash_pos == NULL)
> +     {
> +             return false; // invalid CIDR range
> +     }
> +     int prefix_len = atoi(slash_pos + 1);

`slash - cidr` calculates the length of the network address in the CIDR 
notation, `atoi(slash + 1)` extracts the prefix length from the cidr string 
which is required to us.

-- 
Reply to this email directly or view it on GitLab: 
https://gitlab.com/gnuwget/wget2/-/merge_requests/521#note_1346107079
You're receiving this email because of your account on gitlab.com.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]