Re: [dev] suckless dns over http client
> What was the motivation behind this line?
> endpoint := c.Endpoints[rand.Int()%len(c.Endpoints)]
Round-robin load-balancing. As it is, non-uniform, if the amount of
endpoints is not a power of 2, but hey, quick and dirty.
Also privacy, to an extent. If one day more public DNS providers offer
similar services, this would be a way of ensuring no single provider
sees all of your DNS traffic.
On 3 April 2018 at 22:30, Calvin Morrison <mutantturkey_AT_gmail.com> wrote:
> On 3 April 2018 at 16:22, harry666t <harry666t_AT_gmail.com> wrote:
>>> There is a small bug on line 34: if the statuscode isn't 200 then the
>>> response body is never closed.
>>
>> Thanks Martin. Fixed.
>>
>>> Probably not a huge deal since this is a command line client, but in
>>> long-running servers this will cause file descriptor leaks.
>>
>> It is a huge deal. If I can't get a small program right, who would
>> ever trust me to write a big one correctly?
>>
>
> What was the motivation behind this line?
>
> endpoint := c.Endpoints[rand.Int()%len(c.Endpoints)]
>
Received on Tue Apr 03 2018 - 22:38:05 CEST
This archive was generated by hypermail 2.3.0
: Tue Apr 03 2018 - 22:48:17 CEST