From ef2a95c46125a5e5402a2ee1e433f78959596d0c Mon Sep 17 00:00:00 2001 From: "zhaozhao.zz" Date: Tue, 14 Aug 2018 14:50:37 +0800 Subject: [PATCH] networking: just move qb_pos instead of sdsrange in processInlineBuffer --- src/networking.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/networking.c b/src/networking.c index 9e1a3a9ef..24432339b 100644 --- a/src/networking.c +++ b/src/networking.c @@ -1152,9 +1152,8 @@ int processInlineBuffer(client *c) { if (querylen == 0 && c->flags & CLIENT_SLAVE) c->repl_ack_time = server.unixtime; - /* Leave data after the first line of the query in the buffer */ - sdsrange(c->querybuf,c->qb_pos+querylen+linefeed_chars,-1); - c->qb_pos = 0; + /* Move querybuffer position to the next query in the buffer. */ + c->qb_pos += querylen+linefeed_chars; /* Setup argv array on client structure */ if (argc) {