| 195 | }; |
| 196 | |
| 197 | static 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 |
nothing calls this directly
no test coverage detected