From 4c26a79a8d5eb80c8e68442486d3ebb1905221fc Mon Sep 17 00:00:00 2001 From: antirez Date: Tue, 24 Mar 2009 15:22:27 +0100 Subject: [PATCH] redis-benchmark sync with the new protocol --- benchmark.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/benchmark.c b/benchmark.c index 51c7e980c..b5c6084d5 100644 --- a/benchmark.c +++ b/benchmark.c @@ -190,11 +190,11 @@ static void readHandler(aeEventLoop *el, int fd, void *privdata, int mask) if (c->replytype == REPLY_BULK) { *p = '\0'; *(p-1) = '\0'; - if (memcmp(c->ibuf,"nil",3) == 0) { + c->readlen = atoi(c->ibuf+1)+2; + if (c->readlen == -1) { clientDone(c); return; } - c->readlen = atoi(c->ibuf)+2; c->ibuf = sdsrange(c->ibuf,(p-c->ibuf)+1,-1); } else { c->ibuf = sdstrim(c->ibuf,"\r\n");