Commit Graph

5 Commits

Author SHA1 Message Date
Rusty Russell 4c7017f607 dns: simplify code by reaping dns child as soon as we have answers.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-11-04 11:17:03 +10:30
Rusty Russell c0766061fa dns: don't allow non-stream sockets.
It was "connecting" to "localhost 30000" successfully, because it was
using UDP.  Oops.

This reveals another issue: init_conn() uses the wrong address to
connect to, as we'd already incremented the pointer in try_connect_one().

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-01-22 06:41:49 +10:30
Rusty Russell fc49e3fd74 daemon: rename 'state' to 'dstate' everywhere.
This is the daemon state, not the state machine state.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-01-22 06:41:49 +10:30
Rusty Russell 366f8a5f3f dns: add failure callback.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-01-22 06:41:48 +10:30
Rusty Russell 39120b3ac6 daemon: async DNS lookups.
Also based on pettycoin code.

(With embarrassing bug fixed where it didn't increment the address used,
 thus using 100% CPU if that connect failed!)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-01-22 06:41:48 +10:30