The command itself usually owns the stream, because jcon may get closed. * The command transfers ownership once it's done though. */
| 110 | /* The command itself usually owns the stream, because jcon may get closed. |
| 111 | * The command transfers ownership once it's done though. */ |
| 112 | static struct json_stream *jcon_new_json_stream(const tal_t *ctx, |
| 113 | struct json_connection *jcon, |
| 114 | struct command *writer) |
| 115 | { |
| 116 | struct json_stream *js = new_json_stream(ctx, writer, jcon->log); |
| 117 | |
| 118 | /* Wake writer to start streaming, in case it's not already. */ |
| 119 | io_wake(jcon); |
| 120 | |
| 121 | /* FIXME: Keep streams around for recycling. */ |
| 122 | tal_arr_expand(&jcon->js_arr, js); |
| 123 | return js; |
| 124 | } |
| 125 | |
| 126 | static void jcon_remove_json_stream(struct json_connection *jcon, |
| 127 | struct json_stream *js) |
no test coverage detected