The command itself usually owns the stream, because jcon may get closed. * The command transfers ownership once it's done though. */
| 123 | /* The command itself usually owns the stream, because jcon may get closed. |
| 124 | * The command transfers ownership once it's done though. */ |
| 125 | static struct json_stream *jcon_new_json_stream(const tal_t *ctx, |
| 126 | struct json_connection *jcon, |
| 127 | struct command *writer) |
| 128 | { |
| 129 | struct json_stream *js = new_json_stream(ctx, writer, jcon->log); |
| 130 | |
| 131 | /* Wake writer to start streaming, in case it's not already. */ |
| 132 | io_wake(jcon); |
| 133 | list_add_tail(&jcon->jsouts, &js->list); |
| 134 | return js; |
| 135 | } |
| 136 | |
| 137 | /* jcon and cmd have separate lifetimes: we detach them on either destruction */ |
| 138 | static void destroy_jcon(struct json_connection *jcon) |
no test coverage detected