MCPcopy Create free account
hub / github.com/ElementsProject/lightning / check_client_write

Function check_client_write

hsmd/test/run-bad-request-close.c:45–57  ·  view source on GitHub ↗

Wrapper around the real io_write_wire_: a closed conn (finish * callback already ran) must never be written to again. */

Source from the content-addressed store, hash-verified

43/* Wrapper around the real io_write_wire_: a closed conn (finish
44 * callback already ran) must never be written to again. */
45static 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. */

Callers

nothing calls this directly

Calls 2

abortFunction · 0.85
io_write_wire_Function · 0.50

Tested by

no test coverage detected