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>2015-03-07 06:42:32 +0300
committermichael-grunder <michael.grunder@gmail.com>2015-05-06 01:19:29 +0300
commit7e7eec6281730163eee5f9e36b0be939b9f12485 (patch)
tree8057fee7be579e12b8cca266db01705b309f01e3 /cluster_library.c
parent260852f562a591fb49727ada4451cd9b6ce7ad45 (diff)
Make RedisCluster::client('list') work like Redis
Diffstat (limited to 'cluster_library.c')
-rw-r--r--cluster_library.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/cluster_library.c b/cluster_library.c
index 6c40e466..51d2c3d1 100644
--- a/cluster_library.c
+++ b/cluster_library.c
@@ -1920,6 +1920,31 @@ PHPAPI void cluster_info_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
}
}
+/* CLIENT LIST response */
+PHPAPI void cluster_client_list_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
+ void *ctx)
+{
+ zval *z_result;
+ char *info;
+
+ /* Read the bulk response */
+ info = redis_sock_read_bulk_reply(c->cmd_sock, c->reply_len TSRMLS_CC);
+ if (info == NULL) {
+ CLUSTER_RETURN_FALSE(c);
+ }
+
+ /* Parse it and free the bulk string */
+ z_result = redis_parse_client_list_response(info);
+ efree(info);
+
+ if (CLUSTER_IS_ATOMIC(c)) {
+ *return_value = *z_result;
+ efree(z_result);
+ } else {
+ add_next_index_zval(c->multi_resp, z_result);
+ }
+}
+
/* MULTI BULK response loop where we might pull the next one */
PHPAPI zval *cluster_zval_mbulk_resp(INTERNAL_FUNCTION_PARAMETERS,
redisCluster *c, int pull, mbulk_cb cb)