summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2015-05-05 16:35:44 +0200
committerantirez <antirez@gmail.com>2015-05-05 16:35:44 +0200
commit2bc1527a9564cf9d7776fc817b8dc13c3e53c1b0 (patch)
tree8a3e1d9885a6314093941c546c62879935684ded
parentf7bd816bbbcb5bb944750c10d798b6b9e63e1d3b (diff)
downloadredis-2bc1527a9564cf9d7776fc817b8dc13c3e53c1b0.tar.gz
processUnblockedClients: don't process clients that blocekd again
-rw-r--r--src/blocked.c11
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);
+ }
}
}
}