Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpredis/phpredis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cluster_library.c5
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