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:
authormichael-grunder <michael.grunder@gmail.com>2014-12-02 02:22:29 +0300
committermichael-grunder <michael.grunder@gmail.com>2015-05-06 01:05:30 +0300
commitd804342a6f8258aa25147eeacbd4e3b22fa4faa6 (patch)
tree2b3a834751e364709cbb3a6f77cddca487d2ecb5 /cluster_library.c
parent1a231a979b5120c14f688097c82588997fca9860 (diff)
Fix variant reply handling
Diffstat (limited to 'cluster_library.c')
-rw-r--r--cluster_library.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/cluster_library.c b/cluster_library.c
index 0600a8f5..09b34fc3 100644
--- a/cluster_library.c
+++ b/cluster_library.c
@@ -183,7 +183,9 @@ clusterReply*
cluster_read_sock_resp(RedisSock *redis_sock, REDIS_REPLY_TYPE type,
size_t len TSRMLS_DC)
{
- clusterReply *r = ecalloc(1, sizeof(clusterReply));
+ clusterReply *r;
+
+ r = ecalloc(1, sizeof(clusterReply));
r->type = type;
// Error flag in case we go recursive
@@ -193,6 +195,9 @@ cluster_read_sock_resp(RedisSock *redis_sock, REDIS_REPLY_TYPE type,
case TYPE_INT:
r->integer = len;
break;
+ case TYPE_LINE:
+ case TYPE_ERR:
+ return r;
case TYPE_BULK:
r->len = len;
r->str = redis_sock_read_bulk_reply(redis_sock, len TSRMLS_CC);
@@ -1702,6 +1707,9 @@ PHPAPI void cluster_variant_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
case TYPE_INT:
RETVAL_LONG(r->integer);
break;
+ case TYPE_ERR:
+ RETVAL_FALSE;
+ break;
case TYPE_LINE:
RETVAL_TRUE;
break;
@@ -1728,6 +1736,9 @@ PHPAPI void cluster_variant_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
case TYPE_INT:
add_next_index_long(c->multi_resp, r->integer);
break;
+ case TYPE_ERR:
+ add_next_index_bool(c->multi_resp, 0);
+ break;
case TYPE_LINE:
add_next_index_bool(c->multi_resp, 1);
break;