summaryrefslogtreecommitdiff
path: root/src/rio.c
diff options
context:
space:
mode:
authorOran Agra <oran@monfort.co.il>2016-04-25 16:49:57 +0300
committerOran Agra <oran@monfort.co.il>2016-04-25 16:49:57 +0300
commit5e3880a492efd6c305d7bde5be44c1de72e15cb0 (patch)
tree420a30abd62505ec7624c45db9b4b4e69d33956d /src/rio.c
parent6ed8c2823065fc32bd8eaa63b42ca41a82b25b39 (diff)
downloadredis-5e3880a492efd6c305d7bde5be44c1de72e15cb0.tar.gz
various cleanups and minor fixes
Diffstat (limited to 'src/rio.c')
-rw-r--r--src/rio.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/rio.c b/src/rio.c
index 37b2b0375..9c7220fcc 100644
--- a/src/rio.c
+++ b/src/rio.c
@@ -163,7 +163,7 @@ void rioInitWithFile(rio *r, FILE *fp) {
* The function returns success as long as we are able to correctly write
* to at least one file descriptor.
*
- * When buf is NULL adn len is 0, the function performs a flush operation
+ * When buf is NULL and len is 0, the function performs a flush operation
* if there is some pending buffer, so this function is also used in order
* to implement rioFdsetFlush(). */
static size_t rioFdsetWrite(rio *r, const void *buf, size_t len) {
@@ -176,7 +176,7 @@ static size_t rioFdsetWrite(rio *r, const void *buf, size_t len) {
* a given size, we actually write to the sockets. */
if (len) {
r->io.fdset.buf = sdscatlen(r->io.fdset.buf,buf,len);
- len = 0; /* Prevent entering the while belove if we don't flush. */
+ len = 0; /* Prevent entering the while below if we don't flush. */
if (sdslen(r->io.fdset.buf) > PROTO_IOBUF_LEN) doflush = 1;
}
@@ -276,6 +276,7 @@ void rioInitWithFdset(rio *r, int *fds, int numfds) {
r->io.fdset.buf = sdsempty();
}
+/* release the rio stream. */
void rioFreeFdset(rio *r) {
zfree(r->io.fdset.fds);
zfree(r->io.fdset.state);