Merge pull request #5136 from 0xtonyxia/fix-xread-id-parse

Fix xreadgroup with '$' ID.
This commit is contained in:
Salvatore Sanfilippo 2018-07-17 17:50:31 +02:00 committed by GitHub
commit 4bff45c7a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1351,6 +1351,11 @@ void xreadCommand(client *c) {
}
if (strcmp(c->argv[i]->ptr,"$") == 0) {
if (xreadgroup) {
addReplyError(c,"The $ ID can be specified only when calling "
"XREAD without GROUP option.");
goto cleanup;
}
if (o) {
stream *s = o->ptr;
ids[id_idx] = s->last_id;
@ -1360,7 +1365,7 @@ void xreadCommand(client *c) {
}
continue;
} else if (strcmp(c->argv[i]->ptr,">") == 0) {
if (!xreadgroup || groupname == NULL) {
if (!xreadgroup) {
addReplyError(c,"The > ID can be specified only when calling "
"XREADGROUP using the GROUP <group> "
"<consumer> option.");