tools/update-ccan.sh: Fixes, and make it a bit friendlier.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccan: update (esp. ccan/io fixes).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
pending: remove unused prev_txhashes field.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
blockfile: load with an io_loop.

More natural, requires less intrusion into io_packet_read.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
log_io: preserve errno.

This is generally a good thing in logging functions.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
peer: make alloc_peer set up peer->log and peer->you.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
packet_io: use fd -> log map.

Doesn't require us seeing inside struct io_plan, which is going away.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
json_rpc: process multiple inputs where available.

0f45401a7f333abec4ad5a912bcadc348facdf92 said we would overwrite output,
but we don't.  So partial revert.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
dns: hand address we're connecting to through to init.

This means we record the address we called connect() on, not where we
ended up (with localhost IPv6 and IPv4, may be different).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
peer: simplify setup code.

Don't create a peer until we're actually connected; use a peer_connecting
structure until then.  This puts peer creation and initialization into
a single place.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccan: update to latest ccan (ccan/io rewrite).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Update to match new ccan/io version.

Particular changes:
1) io_* now take the conn as first arg.
2) io_plan * is returned intead of io_plan.
3) io_new_conn needs a callback, rather than an inline call.
4) io_break() is a separate function, you still need a plan.
5) io_duplex() just creates two plans, not two conns.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
protocol_net: actually pad protocol_pkt_welcome to 32 bits.

There was 2 bytes of undocumented padding.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>