X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/bfe85f7ca97259256e8089349e1a462b6c7dbd00..2ebd2720b37dcca3b6e0c18377bd69e9eaf541fc:/deps/hiredis/hiredis.c diff --git a/deps/hiredis/hiredis.c b/deps/hiredis/hiredis.c index f2135bac..976e94f9 100644 --- a/deps/hiredis/hiredis.c +++ b/deps/hiredis/hiredis.c @@ -50,7 +50,7 @@ typedef struct redisReader { size_t pos; /* buffer cursor */ size_t len; /* buffer length */ - redisReadTask rstack[3]; /* stack of read tasks */ + redisReadTask rstack[9]; /* stack of read tasks */ int ridx; /* index of stack */ void *privdata; /* user-settable arbitrary field */ } redisReader; @@ -347,9 +347,9 @@ static int processMultiBulkItem(redisReader *r) { int root = 0; /* Set error for nested multi bulks with depth > 1 */ - if (r->ridx == 2) { + if (r->ridx == 8) { redisSetReplyReaderError(r,sdscatprintf(sdsempty(), - "No support for nested multi bulk replies with depth > 1")); + "No support for nested multi bulk replies with depth > 7")); return -1; } @@ -520,13 +520,14 @@ void redisReplyReaderFeed(void *reader, const char *buf, size_t len) { /* Copy the provided buffer. */ if (buf != NULL && len >= 1) { +#if 0 /* Destroy internal buffer when it is empty and is quite large. */ if (r->len == 0 && sdsavail(r->buf) > 16*1024) { sdsfree(r->buf); r->buf = sdsempty(); r->pos = 0; } - +#endif r->buf = sdscatlen(r->buf,buf,len); r->len = sdslen(r->buf); } @@ -901,7 +902,7 @@ static void __redisCreateReplyReader(redisContext *c) { * After this function is called, you may use redisContextReadReply to * see if there is a reply available. */ int redisBufferRead(redisContext *c) { - char buf[2048]; + char buf[1024*16]; int nread = read(c->fd,buf,sizeof(buf)); if (nread == -1) { if (errno == EAGAIN && !(c->flags & REDIS_BLOCK)) {