[dev] Opinions on single-header C libraries

2018-04-03 Thread markweston
I was surprised I didn't find a word mentioned about single header libraries. The trend has been started by Sean T. Barrett. The libraries in practice are primarily used for game development. Here's his repository: https://github.com/nothings/stb In there, most notable ones would probably be stb_

Re: [dev] Opinions on single-header C libraries

2018-04-03 Thread Laslo Hunhold
On Tue, 03 Apr 2018 16:18:13 +0300 markwes...@cock.li wrote: Oh, Hi Mark, > I am particularly interested in the idea of replacing the heavy, > official format libraries (libvorbisfile, libpng, freetype) with > their single-header-library counterparts. > - are slightly slower > - are buggier > -

Re: [dev] suckless dns over http client

2018-04-03 Thread Laslo Hunhold
On Tue, 3 Apr 2018 00:12:01 -0400 Calvin Morrison wrote: Hey Calvin, > Presenting sdohd(1) - simple dns over https daemon [0]f > > okay I wrote it see below. depends on curl, also i havent written C in > a long time so I didn't really have a good grasp on allocating stuff, > nor did i read the

Re: [dev] suckless dns over http client

2018-04-03 Thread Calvin Morrison
On 3 April 2018 at 15:43, Laslo Hunhold wrote: > On Tue, 3 Apr 2018 00:12:01 -0400 > Calvin Morrison wrote: > > Hey Calvin, > > I'm pretty sure DNS over HTTPS runs on top of a TCP stream and not a > UDP stream. > standard DNS requests are made via UDP on port 53. This tool relays those requests

Re: [dev] suckless dns over http client

2018-04-03 Thread harry666t
My take - if you don't mind Go... https://github.com/rollcat/gdoh No forking, no dependencies outside of stdlib, async queries/responses, allows using multiple providers, 78 loc. > I'm pretty sure DNS over HTTPS runs on top of a TCP stream and not a UDP > stream. In Calvin's sdohd, it's curl doi

Re: [dev] suckless dns over http client

2018-04-03 Thread Martin Tournoij
On Tue, Apr 3, 2018, at 21:12, harry666t wrote: > My take - if you don't mind Go... > https://github.com/rollcat/gdoh > No forking, no dependencies outside of stdlib, async > queries/responses, allows using multiple providers, 78 loc. There is a small bug on line 34: if the statuscode isn't 200 th

Re: [dev] suckless dns over http client

2018-04-03 Thread Laslo Hunhold
On Tue, 3 Apr 2018 22:12:02 +0200 harry666t wrote: Hey Harry, > In Calvin's sdohd, it's curl doing all of the TCP+TLS+HTTPS heavy > lifting. The UDP socket accepts actual DNS requests from the local > machine and mangles them into DoH. that's very interesting. Thanks for clearing that part up!

Re: [dev] suckless dns over http client

2018-04-03 Thread Calvin Morrison
>> In Calvin's sdohd, it's curl doing all of the TCP+TLS+HTTPS heavy >> lifting. The UDP socket accepts actual DNS requests from the local >> machine and mangles them into DoH. I am now thinking we might be able to work this thing entirely as a script. socat provides a forking solution for incomin

Re: [dev] suckless dns over http client

2018-04-03 Thread harry666t
> 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

Re: [dev] suckless dns over http client

2018-04-03 Thread Calvin Morrison
On 3 April 2018 at 16:22, harry666t 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 des

Re: [dev] suckless dns over http client

2018-04-03 Thread harry666t
> 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 si

Re: [dev] securiy guidance

2018-04-03 Thread petern
On 2018-03-10 03:59, Markus Teich wrote: > Am 2018-03-08 18:47, schrieb pet...@riseup.net: >> Looking at the chacha API one needs to use a nonce, in the monocypher >> implementation it is 24 bits wide, which would give the option of almost >> 17M runs with a single key. IIUC adding a salt would fur