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:
Diffstat (limited to 'cluster_library.c')
-rw-r--r--cluster_library.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/cluster_library.c b/cluster_library.c
index 8810a289..b7b299a8 100644
--- a/cluster_library.c
+++ b/cluster_library.c
@@ -10,6 +10,7 @@ extern zend_class_entry *redis_cluster_exception_ce;
/* Some debug methods that will go away when we're through with them */
+/*
static void cluster_dump_nodes(redisCluster *c) {
redisClusterNode *p;
@@ -39,7 +40,7 @@ static void cluster_log(char *fmt, ...)
fprintf(stderr, "%s\n", buffer);
}
-/* Debug function to dump a clusterReply structure recursively */
+// Debug function to dump a clusterReply structure recursively
static void dump_reply(clusterReply *reply, int indent) {
smart_string buf = {0};
int i;
@@ -86,6 +87,7 @@ static void dump_reply(clusterReply *reply, int indent) {
efree(buf.c);
}
}
+*/
/* Recursively free our reply object. If free_data is non-zero we'll also free
* the payload data (strings) themselves. If not, we just free the structs */
@@ -115,7 +117,7 @@ static void
cluster_multibulk_resp_recursive(RedisSock *sock, size_t elements,
clusterReply **element, int *err TSRMLS_DC)
{
- size_t idx = 0;
+ size_t idx = 0, sz;
clusterReply *r;
long len;
char buf[1024];
@@ -136,10 +138,11 @@ cluster_multibulk_resp_recursive(RedisSock *sock, size_t elements,
switch(r->type) {
case TYPE_ERR:
case TYPE_LINE:
- if(redis_sock_gets(sock, buf, sizeof(buf), &r->len) < 0) {
+ if(redis_sock_gets(sock, buf, sizeof(buf), &sz) < 0) {
*err = 1;
return;
}
+ r->len = (long long)sz;
break;
case TYPE_INT:
r->integer = len;
@@ -893,6 +896,7 @@ cluster_map_keyspace(redisCluster *c TSRMLS_DC) {
if(!mapped && slots) {
memset(c->master, 0, sizeof(redisClusterNode*)*REDIS_CLUSTER_SLOTS);
}
+ redis_sock_disconnect(seed TSRMLS_CC);
}
// Clean up slots reply if we got one