Clarify why remaining may be zero in readQueryFromClient().

See #5304.
This commit is contained in:
antirez
2018-09-05 19:55:38 +02:00
parent 2eed31a59e
commit a0dd6f822b
+2
View File
@@ -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;
}