Wrapper around the real io_write_wire_: a closed conn (finish * callback already ran) must never be written to again. */
| 43 | /* Wrapper around the real io_write_wire_: a closed conn (finish |
| 44 | * callback already ran) must never be written to again. */ |
| 45 | static struct io_plan *check_client_write(struct io_conn *conn, |
| 46 | const u8 *data, |
| 47 | struct io_plan *(*next)(struct io_conn *, void *), |
| 48 | void *next_arg) |
| 49 | { |
| 50 | if (conn == client_conn && finish_count != 0) { |
| 51 | fprintf(stderr, |
| 52 | "write to client conn after close (finish_count=%d)\n", |
| 53 | finish_count); |
| 54 | abort(); |
| 55 | } |
| 56 | return io_write_wire_(conn, data, next, next_arg); |
| 57 | } |
| 58 | |
| 59 | /* Redefine io_write_wire before pulling in hsmd.c, so every write the |
| 60 | * daemon makes (req_reply in particular) goes through the check above. */ |
nothing calls this directly
no test coverage detected