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

Function pump_next

common/test/run-jsonrpc_io.c:197–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195};
196
197static struct io_plan *pump_next(struct io_conn *conn, struct pump_ctx *pc)
198{
199 for (;;) {
200 const jsmntok_t *toks;
201 const char *buf;
202 const char *err = jsonrpc_io_parse(tmpctx, pc->jin, &toks, &buf);
203
204 assert(!err);
205 if (!toks) {
206 /* Need more bytes */
207 return jsonrpc_io_read(conn, pc->jin, pump_next, pc);
208 }
209
210 /* Got a full JSON-RPC message */
211 record_message(buf, toks, pc->hc);
212 jsonrpc_io_parse_done(pc->jin);
213
214 /* Loop to consume any additional buffered messages
215 * without asking for more input yet. */
216 }
217}
218
219/* ---------- helpers ---------- */
220

Callers

nothing calls this directly

Calls 3

jsonrpc_io_parseFunction · 0.85
record_messageFunction · 0.85
jsonrpc_io_parse_doneFunction · 0.85

Tested by

no test coverage detected