Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
b5be5093
Commit
b5be5093
authored
Sep 08, 2017
by
antirez
Browse files
Streams: fix XREAD timeout handling, zero is valid.
parent
2cacdcd6
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/t_stream.c
View file @
b5be5093
...
@@ -398,7 +398,7 @@ void xlenCommand(client *c) {
...
@@ -398,7 +398,7 @@ void xlenCommand(client *c) {
* [RETRY <milliseconds> <ttl>] STREAMS key_1 key_2 ... key_N
* [RETRY <milliseconds> <ttl>] STREAMS key_1 key_2 ... key_N
* ID_1 ID_2 ... ID_N */
* ID_1 ID_2 ... ID_N */
void
xreadCommand
(
client
*
c
)
{
void
xreadCommand
(
client
*
c
)
{
long
long
timeout
=
0
;
long
long
timeout
=
-
1
;
/* -1 means, no BLOCK argument given. */
long
long
count
=
0
;
long
long
count
=
0
;
int
streams_count
=
0
;
int
streams_count
=
0
;
int
streams_arg
=
0
;
int
streams_arg
=
0
;
...
@@ -499,7 +499,7 @@ void xreadCommand(client *c) {
...
@@ -499,7 +499,7 @@ void xreadCommand(client *c) {
}
}
/* Block if needed. */
/* Block if needed. */
if
(
timeout
)
{
if
(
timeout
!=
-
1
)
{
/* If we are inside a MULTI/EXEC and the list is empty the only thing
/* If we are inside a MULTI/EXEC and the list is empty the only thing
* we can do is treating it as a timeout (even with timeout 0). */
* we can do is treating it as a timeout (even with timeout 0). */
if
(
c
->
flags
&
CLIENT_MULTI
)
{
if
(
c
->
flags
&
CLIENT_MULTI
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment