| 181 | } |
| 182 | |
| 183 | static struct io_plan *stderr_read_more(struct io_conn *conn, |
| 184 | struct reckless *rkls) |
| 185 | { |
| 186 | rkls->stderr_read += rkls->stderr_new; |
| 187 | if (rkls->stderr_read == tal_count(rkls->stderrbuf)) |
| 188 | tal_resize(&rkls->stderrbuf, rkls->stderr_read * 2); |
| 189 | if (strends(rkls->stderrbuf, "[Y] to create one now.\n")) { |
| 190 | plugin_log(plugin, LOG_DBG, "confirming config creation"); |
| 191 | reckless_send_yes(rkls); |
| 192 | } |
| 193 | /* Old version of reckless installed? */ |
| 194 | if (strstr(rkls->stderrbuf, "error: unrecognized arguments: --json")) { |
| 195 | plugin_log(plugin, LOG_DBG, "Reckless call failed due to old " |
| 196 | "installed version."); |
| 197 | rkls->process_failed = tal_strdup(plugin, "The installed " |
| 198 | "reckless utility is out of " |
| 199 | "date. Please update to use " |
| 200 | "the RPC plugin."); |
| 201 | } |
| 202 | return io_read_partial(conn, rkls->stderrbuf + rkls->stderr_read, |
| 203 | tal_count(rkls->stderrbuf) - rkls->stderr_read, |
| 204 | &rkls->stderr_new, stderr_read_more, rkls); |
| 205 | } |
| 206 | |
| 207 | static struct io_plan *stderr_conn_init(struct io_conn *conn, |
| 208 | struct reckless *reckless) |
no test coverage detected