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

Function ld_read_json

plugins/libplugin.c:2264–2289  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2262}
2263
2264static struct io_plan *ld_read_json(struct io_conn *conn,
2265 struct plugin *plugin)
2266{
2267 /* Gather an parse any new bytes */
2268 for (;;) {
2269 const jsmntok_t *toks;
2270 const char *buf;
2271 const char *err;
2272
2273 err = jsonrpc_io_parse(tmpctx,
2274 plugin->lightningd_in,
2275 &toks, &buf);
2276 if (err)
2277 plugin_err(plugin, "%s", err);
2278
2279 if (!toks)
2280 break;
2281
2282 ld_command_handle(plugin, buf, toks);
2283 jsonrpc_io_parse_done(plugin->lightningd_in);
2284 }
2285
2286 /* Read more */
2287 return jsonrpc_io_read(conn, plugin->lightningd_in,
2288 ld_read_json, plugin);
2289}
2290
2291static struct io_plan *ld_write_json(struct io_conn *conn,
2292 struct plugin *plugin);

Callers 1

stdin_conn_initFunction · 0.85

Calls 4

jsonrpc_io_parseFunction · 0.85
ld_command_handleFunction · 0.85
jsonrpc_io_parse_doneFunction · 0.85
plugin_errFunction · 0.70

Tested by

no test coverage detected