Create an RIO that implements a buffered read from an fd * read_limit argument stops buffering when the reaching the limit. */
| 294 | /* Create an RIO that implements a buffered read from an fd |
| 295 | * read_limit argument stops buffering when the reaching the limit. */ |
| 296 | void 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. */ |
no test coverage detected