diff options
author | antirez <antirez@gmail.com> | 2015-05-05 16:35:44 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2015-05-05 16:35:44 +0200 |
commit | 2bc1527a9564cf9d7776fc817b8dc13c3e53c1b0 (patch) | |
tree | 8a3e1d9885a6314093941c546c62879935684ded | |
parent | f7bd816bbbcb5bb944750c10d798b6b9e63e1d3b (diff) | |
download | redis-2bc1527a9564cf9d7776fc817b8dc13c3e53c1b0.tar.gz |
processUnblockedClients: don't process clients that blocekd again
-rw-r--r-- | src/blocked.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/blocked.c b/src/blocked.c index 3442b9dd4..c4618a5cc 100644 --- a/src/blocked.c +++ b/src/blocked.c @@ -117,9 +117,14 @@ void processUnblockedClients(void) { listDelNode(server.unblocked_clients,ln); c->flags &= ~REDIS_UNBLOCKED; - /* Process remaining data in the input buffer. */ - if (c->querybuf && sdslen(c->querybuf) > 0) { - processInputBuffer(c); + /* Process remaining data in the input buffer, unless the client + * is blocked again. Actually processInputBuffer() checks that the + * client is not blocked before to proceed, but things may change and + * the code is conceptually more correct this way. */ + if (!(c->flags & DISQUE_BLOCKED)) { + if (c->querybuf && sdslen(c->querybuf) > 0) { + processInputBuffer(c); + } } } } |