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

Function io_read_partial_test

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

Source from the content-addressed store, hash-verified

147}
148
149static struct io_plan *io_read_partial_test(struct io_conn *conn,
150 void *data,
151 size_t maxlen,
152 size_t *lenp,
153 struct io_plan *(*next)(struct io_conn *, void *),
154 void *arg)
155{
156 char *out = (char *)data;
157 size_t n = feed_next_chunk(maxlen);
158
159 FEED.calls_to_io_read++;
160 if (n) {
161 memcpy(out, FEED.data + FEED.off, n);
162 FEED.off += n;
163 }
164 *lenp = n;
165
166 /* No more input -> end the chain */
167 if (n == 0)
168 return NULL;
169
170 return next(conn, arg);
171}
172
173/* ---------- minimal “handler” to count parsed messages ---------- */
174

Callers

nothing calls this directly

Calls 2

feed_next_chunkFunction · 0.85
nextFunction · 0.85

Tested by

no test coverage detected