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

Function stderr_read_more

plugins/recklessrpc.c:183–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181}
182
183static 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
207static struct io_plan *stderr_conn_init(struct io_conn *conn,
208 struct reckless *reckless)

Callers 1

stderr_conn_initFunction · 0.85

Calls 3

strendsFunction · 0.85
reckless_send_yesFunction · 0.85
plugin_logFunction · 0.70

Tested by

no test coverage detected