diff options
author | antirez <antirez@gmail.com> | 2018-09-04 13:29:24 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2018-09-04 13:29:27 +0200 |
commit | 4e5e0d3719ffed0d3a687fa2082655f97e16167c (patch) | |
tree | 819a1863cfc8539452eceb95a3f8292e486553e0 | |
parent | ff57b8d550b4ef90f33dc89d7179b05ad6d1258d (diff) | |
download | redis-4e5e0d3719ffed0d3a687fa2082655f97e16167c.tar.gz |
Clarify why remaining may be zero in readQueryFromClient().
See #5304.
-rw-r--r-- | src/networking.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/networking.c b/src/networking.c index 605621c1c..01307c7a3 100644 --- a/src/networking.c +++ b/src/networking.c @@ -1466,6 +1466,8 @@ void readQueryFromClient(aeEventLoop *el, int fd, void *privdata, int mask) { { ssize_t remaining = (size_t)(c->bulklen+2)-sdslen(c->querybuf); + /* Note that the 'remaining' variable may be zero in some edge case, + * for example once we resume a blocked client after CLIENT PAUSE. */ if (remaining > 0 && remaining < readlen) readlen = remaining; } |