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

Function jsonrpc_sync_read

common/jsonrpc_io.c:133–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131}
132
133bool jsonrpc_sync_read(struct jsonrpc_io *json_in, int infd)
134{
135 int r;
136
137 /* Make sure there's more room */
138 membuf_prepare_space(&json_in->membuf, READ_CHUNKSIZE);
139
140 /* Try to read more. */
141 r = read(infd,
142 membuf_space(&json_in->membuf),
143 membuf_num_space(&json_in->membuf));
144 if (r < 0)
145 return false;
146 if (r == 0) {
147 errno = 0;
148 return false;
149 }
150 json_in->bytes_read = r;
151 return true;
152}

Callers 1

read_one_json_syncFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected