diff options
author | michael-grunder <michael.grunder@gmail.com> | 2020-08-15 12:24:31 -0700 |
---|---|---|
committer | Yossi Gottlieb <yossigo@gmail.com> | 2022-02-14 14:00:57 +0200 |
commit | 47400870ae25a62aa6fa85e9c26af1c357a44b79 (patch) | |
tree | 456d3ccb604a27871a0e1c87298d71a3db9d382e /deps/hiredis/read.c | |
parent | 886a04c2c3899611b352e87070aa874e321f9034 (diff) | |
download | redis-47400870ae25a62aa6fa85e9c26af1c357a44b79.tar.gz |
Reapply: Rename sds calls so they don't conflict.
Reapply this commit on top of hiredis as a local change. Previosuly it
was pulled from a private hiredis branch, which resulted with it going
away on subtree pull.
Diffstat (limited to 'deps/hiredis/read.c')
-rw-r--r-- | deps/hiredis/read.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/deps/hiredis/read.c b/deps/hiredis/read.c index de62b9ab0..6c19c5a5e 100644 --- a/deps/hiredis/read.c +++ b/deps/hiredis/read.c @@ -59,7 +59,7 @@ static void __redisReaderSetError(redisReader *r, int type, const char *str) { } /* Clear input buffer on errors. */ - sdsfree(r->buf); + hi_sdsfree(r->buf); r->buf = NULL; r->pos = r->len = 0; @@ -655,7 +655,7 @@ redisReader *redisReaderCreateWithFunctions(redisReplyObjectFunctions *fn) { if (r == NULL) return NULL; - r->buf = sdsempty(); + r->buf = hi_sdsempty(); if (r->buf == NULL) goto oom; @@ -696,12 +696,12 @@ void redisReaderFree(redisReader *r) { hi_free(r->task); } - sdsfree(r->buf); + hi_sdsfree(r->buf); hi_free(r); } int redisReaderFeed(redisReader *r, const char *buf, size_t len) { - sds newbuf; + hisds newbuf; /* Return early when this reader is in an erroneous state. */ if (r->err) @@ -710,19 +710,19 @@ int redisReaderFeed(redisReader *r, const char *buf, size_t len) { /* Copy the provided buffer. */ if (buf != NULL && len >= 1) { /* Destroy internal buffer when it is empty and is quite large. */ - if (r->len == 0 && r->maxbuf != 0 && sdsavail(r->buf) > r->maxbuf) { - sdsfree(r->buf); - r->buf = sdsempty(); + if (r->len == 0 && r->maxbuf != 0 && hi_sdsavail(r->buf) > r->maxbuf) { + hi_sdsfree(r->buf); + r->buf = hi_sdsempty(); if (r->buf == 0) goto oom; r->pos = 0; } - newbuf = sdscatlen(r->buf,buf,len); + newbuf = hi_sdscatlen(r->buf,buf,len); if (newbuf == NULL) goto oom; r->buf = newbuf; - r->len = sdslen(r->buf); + r->len = hi_sdslen(r->buf); } return REDIS_OK; @@ -767,9 +767,9 @@ int redisReaderGetReply(redisReader *r, void **reply) { /* Discard part of the buffer when we've consumed at least 1k, to avoid * doing unnecessary calls to memmove() in sds.c. */ if (r->pos >= 1024) { - if (sdsrange(r->buf,r->pos,-1) < 0) return REDIS_ERR; + if (hi_sdsrange(r->buf,r->pos,-1) < 0) return REDIS_ERR; r->pos = 0; - r->len = sdslen(r->buf); + r->len = hi_sdslen(r->buf); } /* Emit a reply when there is one. */ |