diff options
Diffstat (limited to 'cluster_library.c')
-rw-r--r-- | cluster_library.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cluster_library.c b/cluster_library.c index 224932bf..4c785703 100644 --- a/cluster_library.c +++ b/cluster_library.c @@ -1439,8 +1439,9 @@ PHP_REDIS_API short cluster_send_command(redisCluster *c, short slot, const char } } - /* Figure out if we've timed out trying to read or write the data */ - timedout = resp && c->waitms ? mstime() - msstart >= c->waitms : 0; + /* We're timed out if cluster_check_response returned -1, or if the + * response was non-zero and we've been in the loop too long */ + timedout = resp == -1 || (resp && c->waitms ? mstime() - msstart >= c->waitms : 0); } while (resp != 0 && !c->clusterdown && !timedout); // If we've detected the cluster is down, throw an exception |