00:51:57  <daurnimator>NiteHawk: I wouldn't treat localhost specially
00:52:25  <daurnimator>NiteHawk: the dns library *should* check /etc/hosts for that information
00:52:55  <daurnimator>note that sometimes people map localhost to other ips instead (e.g. for some interesting security by obscurity
01:00:48  <NiteHawk>daurnimator: valid point. and it also means ending up with cleaner code - https://github.com/n1tehawk/luvit/blob/20170129_resolvebyip/deps/dns.lua#L618-L625
01:01:37  <daurnimator>NiteHawk: can make it even simpler with a single `id`
01:01:41  <daurnimator>*if
01:05:46  <NiteHawk>ah, you mean "or"ing the two conditions, since the branches are identical instruction-wise?
01:09:16  <daurnimator>yes
01:09:58  <NiteHawk>good idea. since only a single invocation of resolve_internal() remains, I could also unroll the function again
02:05:35  * DarkGodquit (Quit: Leaving)
03:49:16  * SkyRocknRolljoined
04:22:11  * landworkquit (Read error: Connection reset by peer)
08:23:13  * rendarjoined
08:29:40  * DarkGodjoined
09:39:04  <NiteHawk>new version at https://github.com/n1tehawk/luvit/commit/416aeea
11:22:23  <NiteHawk>btw: daurnimator - for what i can tell from the `servers` field in `answers`, the dns module doesn't consult the local resolver library (and thus /etc/hosts) for "localhost". instead an actual DNS query goes out to the (external) servers
11:26:40  <NiteHawk>can be verified by: luvit -e 'require("dns").resolve4("localhost", require("pretty-print").prettyPrint)'
12:28:35  * whethereverquit (Ping timeout: 255 seconds)
13:04:31  <daurnimator>NiteHawk: okay.... sounds like the dns library should gain some abilities
13:29:46  <NiteHawk>daurnimator: may not even be luvit's fault - if i read some comments correctly, it relies on libuv for actual name resolution?
13:30:01  * daurnimatordoesn't know
13:31:13  <NiteHawk>anyway, that what got me tinkering with the "localhost" - but I guess it's preferable if users would 'hardcode' the IP in these cases...
13:47:51  <daurnimator>NiteHawk: really you should be looking at /etc/hosts
13:48:16  <daurnimator>does the library look at /etc/resolv.conf? what about /etc/nsswitch.conf ?
13:48:47  <daurnimator>what a library is 'meant' to do is 1. get the "hosts" line from /etc/nsswitch.conf.
13:48:59  <daurnimator>then iterate through it, doing the various options
13:49:06  <daurnimator>'files' means look at /etc/hosts
13:49:23  <daurnimator>'dns' means query the dns server in /etc/resolv.conf
13:49:41  <daurnimator>'mymachines' means load up the systemd component and ask it what containers are running :p
13:58:06  <NiteHawk>daurnimator: that part works, i.e. the dns module consideres /etc/resolv.conf to figure out the default DNS server(s)
13:58:47  <NiteHawk>but i highly doubt that it will use/respect local hosts file (entries) - admittedly i'd have to cross-check that to be sure
13:59:51  <daurnimator>NiteHawk: if you want to do things 'properly' then you should introduce a nsswitch.conf parser
14:00:22  <daurnimator>I don't recommend you actually then go on and implement the NSS shared module system. but use the settings in nsswitch.conf to inform the process of dns lookups
14:00:44  <NiteHawk>and i'm not in the mood to fix it all. i'm content if it doesn't forward 'numeric' addresses to the DNS servers, which is likely to fail (= solicit a "3: name error" response) anyway
16:22:05  * SkyRocknRollquit (Remote host closed the connection)
16:58:03  * Xequit (Ping timeout: 252 seconds)
17:08:10  * Xejoined
18:02:18  * DarkGodquit (Quit: Leaving)
19:33:23  * rendarquit (Ping timeout: 255 seconds)
19:50:59  * DarkGodjoined
20:36:32  * rendarjoined
20:36:32  * rendarquit (Changing host)
20:36:32  * rendarjoined
21:18:49  * whethereverjoined
21:51:11  * whethereverquit (Ping timeout: 240 seconds)
22:48:15  * rendarquit (Quit: std::lower_bound + std::less_equal *works* with a vector without duplicates!)