MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / rioInitWithConn

Function rioInitWithConn

src/rio.cpp:296–304  ·  view source on GitHub ↗

Create an RIO that implements a buffered read from an fd * read_limit argument stops buffering when the reaching the limit. */

Source from the content-addressed store, hash-verified

294/* Create an RIO that implements a buffered read from an fd
295 * read_limit argument stops buffering when the reaching the limit. */
296void rioInitWithConn(rio *r, connection *conn, size_t read_limit) {
297 *r = rioConnIO;
298 r->io.conn.conn = conn;
299 r->io.conn.pos = 0;
300 r->io.conn.read_limit = read_limit;
301 r->io.conn.read_so_far = 0;
302 r->io.conn.buf = sdsnewlen(NULL, PROTO_IOBUF_LEN);
303 sdsclear(r->io.conn.buf);
304}
305
306/* Release the RIO stream. Optionally returns the unread buffered data
307 * when the SDS pointer 'remaining' is passed. */

Callers 1

readSyncBulkPayloadRdbFunction · 0.85

Calls 2

sdsnewlenFunction · 0.85
sdsclearFunction · 0.85

Tested by

no test coverage detected