Create an RIO that implements a buffered read from an fd * read_limit argument stops buffering when the reaching the limit. */
| 253 | /* Create an RIO that implements a buffered read from an fd |
| 254 | * read_limit argument stops buffering when the reaching the limit. */ |
| 255 | void rioInitWithConn(rio *r, connection *conn, size_t read_limit) { |
| 256 | *r = rioConnIO; |
| 257 | r->io.conn.conn = conn; |
| 258 | r->io.conn.pos = 0; |
| 259 | r->io.conn.read_limit = read_limit; |
| 260 | r->io.conn.read_so_far = 0; |
| 261 | r->io.conn.buf = sdsnewlen(NULL, PROTO_IOBUF_LEN); |
| 262 | sdsclear(r->io.conn.buf); |
| 263 | } |
| 264 | |
| 265 | /* Release the RIO stream. Optionally returns the unread buffered data |
| 266 | * when the SDS pointer 'remaining' is passed. */ |
no test coverage detected