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

Function ld_read_json

plugins/libplugin.c:2274–2299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2272}
2273
2274static struct io_plan *ld_read_json(struct io_conn *conn,
2275 struct plugin *plugin)
2276{
2277 /* Gather an parse any new bytes */
2278 for (;;) {
2279 const jsmntok_t *toks;
2280 const char *buf;
2281 const char *err;
2282
2283 err = jsonrpc_io_parse(tmpctx,
2284 plugin->lightningd_in,
2285 &toks, &buf);
2286 if (err)
2287 plugin_err(plugin, "%s", err);
2288
2289 if (!toks)
2290 break;
2291
2292 ld_command_handle(plugin, buf, toks);
2293 jsonrpc_io_parse_done(plugin->lightningd_in);
2294 }
2295
2296 /* Read more */
2297 return jsonrpc_io_read(conn, plugin->lightningd_in,
2298 ld_read_json, plugin);
2299}
2300
2301static struct io_plan *ld_write_json(struct io_conn *conn,
2302 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