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:
authorPavlo Yatsukhnenko <yatsukhnenko@gmail.com>2017-11-17 12:02:41 +0300
committerPavlo Yatsukhnenko <yatsukhnenko@gmail.com>2017-11-17 12:02:41 +0300
commit67babe15d39202ad25d8b0ddbd5a18f097a7241e (patch)
tree6304f64f6142acce990c5c15dcf464ba2851af8a /redis_cluster.c
parent7c5a68c88651ed8f91071b9ddf148a1036171486 (diff)
Remove trailing spaces
Diffstat (limited to 'redis_cluster.c')
-rw-r--r--redis_cluster.c136
1 files changed, 68 insertions, 68 deletions
diff --git a/redis_cluster.c b/redis_cluster.c
index f1136471..95bcba40 100644
--- a/redis_cluster.c
+++ b/redis_cluster.c
@@ -147,7 +147,7 @@ zend_function_entry redis_cluster_functions[] = {
PHP_ME(RedisCluster, get, arginfo_key, ZEND_ACC_PUBLIC)
PHP_ME(RedisCluster, getbit, arginfo_key_offset, ZEND_ACC_PUBLIC)
PHP_ME(RedisCluster, getlasterror, arginfo_void, ZEND_ACC_PUBLIC)
- PHP_ME(RedisCluster, getmode, arginfo_void, ZEND_ACC_PUBLIC)
+ PHP_ME(RedisCluster, getmode, arginfo_void, ZEND_ACC_PUBLIC)
PHP_ME(RedisCluster, getoption, arginfo_getoption, ZEND_ACC_PUBLIC)
PHP_ME(RedisCluster, getrange, arginfo_key_start_end, ZEND_ACC_PUBLIC)
PHP_ME(RedisCluster, getset, arginfo_key_value, ZEND_ACC_PUBLIC)
@@ -308,7 +308,7 @@ create_cluster_context(zend_class_entry *class_type TSRMLS_DC) {
// Allocate our actual struct
cluster = ecalloc(1, sizeof(redisCluster) + sizeof(zval) * (class_type->default_properties_count - 1));
#endif
-
+
// We're not currently subscribed anywhere
cluster->subscribed_slot = -1;
@@ -391,7 +391,7 @@ void redis_cluster_init(redisCluster *c, HashTable *ht_seeds, double timeout,
{
// Validate timeout
if(timeout < 0L || timeout > INT_MAX) {
- zend_throw_exception(redis_cluster_exception_ce,
+ zend_throw_exception(redis_cluster_exception_ce,
"Invalid timeout", 0 TSRMLS_CC);
}
@@ -410,14 +410,14 @@ void redis_cluster_init(redisCluster *c, HashTable *ht_seeds, double timeout,
* socket type operations */
c->timeout = timeout;
c->read_timeout = read_timeout;
-
+
/* Set our option to use or not use persistent connections */
c->persistent = persistent;
/* Calculate the number of miliseconds we will wait when bouncing around,
* (e.g. a node goes down), which is not the same as a standard timeout. */
c->waitms = (long)(timeout * 1000);
-
+
// Initialize our RedisSock "seed" objects
cluster_init_seeds(c, ht_seeds);
@@ -445,7 +445,7 @@ void redis_cluster_load(redisCluster *c, char *name, int name_len TSRMLS_DC) {
zend_throw_exception(redis_cluster_exception_ce, "Couldn't find seeds for cluster", 0 TSRMLS_CC);
return;
}
-
+
/* Connection timeout */
array_init(&z_timeout);
if ((iptr = INI_STR("redis.clusters.timeout")) != NULL) {
@@ -490,7 +490,7 @@ void redis_cluster_load(redisCluster *c, char *name, int name_len TSRMLS_DC) {
}
/* Attempt to create/connect to the cluster */
- redis_cluster_init(c, ht_seeds, timeout, read_timeout, persistent TSRMLS_CC);
+ redis_cluster_init(c, ht_seeds, timeout, read_timeout, persistent TSRMLS_CC);
/* Clean up our arrays */
zval_dtor(&z_seeds);
@@ -538,7 +538,7 @@ PHP_METHOD(RedisCluster, __construct) {
}
}
-/*
+/*
* RedisCluster method implementation
*/
@@ -561,8 +561,8 @@ PHP_METHOD(RedisCluster, set) {
/* }}} */
/* Generic handler for MGET/MSET/MSETNX */
-static int
-distcmd_resp_handler(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c, short slot,
+static int
+distcmd_resp_handler(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c, short slot,
clusterMultiCmd *mc, zval *z_ret, int last, cluster_cb cb)
{
clusterMultiCtx *ctx;
@@ -614,7 +614,7 @@ typedef struct clusterKeyValHT {
} clusterKeyValHT;
/* Helper to pull a key/value pair from a HashTable */
-static int get_key_val_ht(redisCluster *c, HashTable *ht, HashPosition *ptr,
+static int get_key_val_ht(redisCluster *c, HashTable *ht, HashPosition *ptr,
clusterKeyValHT *kv TSRMLS_DC)
{
zval *z_val;
@@ -779,11 +779,11 @@ static int cluster_mkey_cmd(INTERNAL_FUNCTION_PARAMETERS, char *kw, int kw_len,
efree(z_args);
return -1;
}
-
+
// If the slots have changed, kick off the keys we've aggregated
if(slot != kv.slot) {
// Process this batch of MGET keys
- if(distcmd_resp_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU, c, slot,
+ if(distcmd_resp_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU, c, slot,
&mc, z_ret, i==argc, cb)<0)
{
cluster_multi_free(&mc);
@@ -803,7 +803,7 @@ static int cluster_mkey_cmd(INTERNAL_FUNCTION_PARAMETERS, char *kw, int kw_len,
if(kv.key_free) efree(kv.key);
// Update the last slot we encountered, and the key we're on
- slot = kv.slot;
+ slot = kv.slot;
i++;
zend_hash_move_forward_ex(ht_arr, &ptr);
@@ -812,7 +812,7 @@ static int cluster_mkey_cmd(INTERNAL_FUNCTION_PARAMETERS, char *kw, int kw_len,
// If we've got straggler(s) process them
if(mc.argc > 0) {
- if(distcmd_resp_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU, c, slot,
+ if(distcmd_resp_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU, c, slot,
&mc, z_ret, 1, cb)<0)
{
cluster_multi_free(&mc);
@@ -892,7 +892,7 @@ static int cluster_mset_cmd(INTERNAL_FUNCTION_PARAMETERS, char *kw, int kw_len,
// If the slots have changed, process responses
if(slot != kv.slot) {
- if(distcmd_resp_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU, c,
+ if(distcmd_resp_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU, c,
slot, &mc, z_ret, i==argc, cb)<0)
{
return -1;
@@ -917,8 +917,8 @@ static int cluster_mset_cmd(INTERNAL_FUNCTION_PARAMETERS, char *kw, int kw_len,
// If we've got stragglers, process them too
if(mc.argc > 0) {
- if(distcmd_resp_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU, c, slot, &mc,
- z_ret, 1, cb)<0)
+ if(distcmd_resp_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU, c, slot, &mc,
+ z_ret, 1, cb)<0)
{
return -1;
}
@@ -949,7 +949,7 @@ PHP_METHOD(RedisCluster, del) {
ZVAL_LONG(z_ret, 0);
// Parse args, process
- if(cluster_mkey_cmd(INTERNAL_FUNCTION_PARAM_PASSTHRU, "DEL",
+ if(cluster_mkey_cmd(INTERNAL_FUNCTION_PARAM_PASSTHRU, "DEL",
sizeof("DEL")-1, z_ret, cluster_del_resp)<0)
{
efree(z_ret);
@@ -992,7 +992,7 @@ PHP_METHOD(RedisCluster, mset) {
ZVAL_TRUE(z_ret);
// Parse args and process. If we get a failure, free zval and return FALSE.
- if(cluster_mset_cmd(INTERNAL_FUNCTION_PARAM_PASSTHRU, "MSET",
+ if(cluster_mset_cmd(INTERNAL_FUNCTION_PARAM_PASSTHRU, "MSET",
sizeof("MSET")-1, z_ret, cluster_mset_resp)==-1)
{
efree(z_ret);
@@ -1004,7 +1004,7 @@ PHP_METHOD(RedisCluster, mset) {
PHP_METHOD(RedisCluster, msetnx) {
zval *z_ret;
- // Array response
+ // Array response
#if (PHP_MAJOR_VERSION < 7)
MAKE_STD_ZVAL(z_ret);
#else
@@ -1092,8 +1092,8 @@ PHP_METHOD(RedisCluster, keys) {
/* Ensure we can get a response */
resp = cluster_read_resp(c TSRMLS_CC);
if(!resp) {
- php_error_docref(0 TSRMLS_CC, E_WARNING,
- "Can't read response from %s:%d", ZSTR_VAL(node->sock->host),
+ php_error_docref(0 TSRMLS_CC, E_WARNING,
+ "Can't read response from %s:%d", ZSTR_VAL(node->sock->host),
node->sock->port);
continue;
}
@@ -1770,10 +1770,10 @@ PHP_METHOD(RedisCluster, zrevrangebyscore) {
}
/* }}} */
-/* {{{ proto array RedisCluster::zrangebylex(string key, string min, string max,
+/* {{{ proto array RedisCluster::zrangebylex(string key, string min, string max,
* [offset, count]) */
PHP_METHOD(RedisCluster, zrangebylex) {
- CLUSTER_PROCESS_KW_CMD("ZRANGEBYLEX", redis_zrangebylex_cmd,
+ CLUSTER_PROCESS_KW_CMD("ZRANGEBYLEX", redis_zrangebylex_cmd,
cluster_mbulk_resp, 1);
}
/* }}} */
@@ -1794,7 +1794,7 @@ PHP_METHOD(RedisCluster, zlexcount) {
/* {{{ proto long RedisCluster::zremrangebylex(string key, string min, string max) */
PHP_METHOD(RedisCluster, zremrangebylex) {
- CLUSTER_PROCESS_KW_CMD("ZREMRANGEBYLEX", redis_gen_zlex_cmd,
+ CLUSTER_PROCESS_KW_CMD("ZREMRANGEBYLEX", redis_gen_zlex_cmd,
cluster_long_resp, 0);
}
/* }}} */
@@ -1880,7 +1880,7 @@ static void generic_unsub_cmd(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
}
// Call directly because we're going to set the slot manually
- if(redis_unsubscribe_cmd(INTERNAL_FUNCTION_PARAM_PASSTHRU, c->flags, kw,
+ if(redis_unsubscribe_cmd(INTERNAL_FUNCTION_PARAM_PASSTHRU, c->flags, kw,
&cmd, &cmd_len, &slot, &ctx)
==FAILURE)
{
@@ -1888,7 +1888,7 @@ static void generic_unsub_cmd(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
}
// This has to operate on our subscribe slot
- if(cluster_send_slot(c, c->subscribed_slot, cmd, cmd_len, TYPE_MULTIBULK
+ if(cluster_send_slot(c, c->subscribed_slot, cmd, cmd_len, TYPE_MULTIBULK
TSRMLS_CC) ==FAILURE)
{
zend_throw_exception(redis_cluster_exception_ce,
@@ -1905,7 +1905,7 @@ static void generic_unsub_cmd(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c,
/* {{{ proto array RedisCluster::unsubscribe(array chans) */
PHP_METHOD(RedisCluster, unsubscribe) {
- generic_unsub_cmd(INTERNAL_FUNCTION_PARAM_PASSTHRU, GET_CONTEXT(),
+ generic_unsub_cmd(INTERNAL_FUNCTION_PARAM_PASSTHRU, GET_CONTEXT(),
"UNSUBSCRIBE");
}
/* }}} */
@@ -1953,33 +1953,33 @@ PHP_METHOD(RedisCluster, getlasterror) {
/* {{{ proto bool RedisCluster::clearlasterror() */
PHP_METHOD(RedisCluster, clearlasterror) {
redisCluster *c = GET_CONTEXT();
-
+
if (c->err) {
zend_string_release(c->err);
c->err = NULL;
}
-
+
RETURN_TRUE;
}
/* }}} */
/* {{{ proto long RedisCluster::getOption(long option */
PHP_METHOD(RedisCluster, getoption) {
- redis_getoption_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU,
+ redis_getoption_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU,
GET_CONTEXT()->flags, GET_CONTEXT());
}
/* }}} */
/* {{{ proto bool RedisCluster::setOption(long option, mixed value) */
PHP_METHOD(RedisCluster, setoption) {
- redis_setoption_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU,
+ redis_setoption_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU,
GET_CONTEXT()->flags, GET_CONTEXT());
}
/* }}} */
/* {{{ proto string RedisCluster::_prefix(string key) */
PHP_METHOD(RedisCluster, _prefix) {
- redis_prefix_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU,
+ redis_prefix_handler(INTERNAL_FUNCTION_PARAM_PASSTHRU,
GET_CONTEXT()->flags);
}
/* }}} */
@@ -2122,7 +2122,7 @@ PHP_METHOD(RedisCluster, watch) {
// Construct our watch command for this node
redis_cmd_init_sstr(&cmd, dl->len, "WATCH", sizeof("WATCH")-1);
for (i = 0; i < dl->len; i++) {
- redis_cmd_append_sstr(&cmd, dl->entry[i].key,
+ redis_cmd_append_sstr(&cmd, dl->entry[i].key,
dl->entry[i].key_len);
}
@@ -2154,7 +2154,7 @@ PHP_METHOD(RedisCluster, unwatch) {
// Send UNWATCH to nodes that need it
for(slot=0;slot<REDIS_CLUSTER_SLOTS;slot++) {
if(c->master[slot] && SLOT_SOCK(c,slot)->watching) {
- if(cluster_send_slot(c, slot, RESP_UNWATCH_CMD,
+ if(cluster_send_slot(c, slot, RESP_UNWATCH_CMD,
sizeof(RESP_UNWATCH_CMD)-1,
TYPE_LINE TSRMLS_CC)==-1)
{
@@ -2194,7 +2194,7 @@ PHP_METHOD(RedisCluster, exec) {
// Free our queue, reset MULTI state
CLUSTER_FREE_QUEUE(c);
CLUSTER_RESET_MULTI(c);
-
+
RETURN_FALSE;
}
SLOT_SOCK(c, fi->slot)->mode = ATOMIC;
@@ -2220,7 +2220,7 @@ PHP_METHOD(RedisCluster, discard) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cluster is not in MULTI mode");
RETURN_FALSE;
}
-
+
if(cluster_abort_exec(c TSRMLS_CC)<0) {
CLUSTER_RESET_MULTI(c);
}
@@ -2232,7 +2232,7 @@ PHP_METHOD(RedisCluster, discard) {
/* Get a slot either by key (string) or host/port array */
static short
-cluster_cmd_get_slot(redisCluster *c, zval *z_arg TSRMLS_DC)
+cluster_cmd_get_slot(redisCluster *c, zval *z_arg TSRMLS_DC)
{
strlen_t key_len;
int key_free;
@@ -2244,7 +2244,7 @@ cluster_cmd_get_slot(redisCluster *c, zval *z_arg TSRMLS_DC)
/* If it's a string, treat it as a key. Otherwise, look for a two
* element array */
if(Z_TYPE_P(z_arg)==IS_STRING || Z_TYPE_P(z_arg)==IS_LONG ||
- Z_TYPE_P(z_arg)==IS_DOUBLE)
+ Z_TYPE_P(z_arg)==IS_DOUBLE)
{
/* Allow for any scalar here */
zstr = zval_get_string(z_arg);
@@ -2256,7 +2256,7 @@ cluster_cmd_get_slot(redisCluster *c, zval *z_arg TSRMLS_DC)
slot = cluster_hash_key(key, key_len);
zend_string_release(zstr);
if(key_free) efree(key);
- } else if (Z_TYPE_P(z_arg) == IS_ARRAY &&
+ } else if (Z_TYPE_P(z_arg) == IS_ARRAY &&
(z_host = zend_hash_index_find(Z_ARRVAL_P(z_arg), 0)) != NULL &&
(z_port = zend_hash_index_find(Z_ARRVAL_P(z_arg), 1)) != NULL &&
Z_TYPE_P(z_host) == IS_STRING && Z_TYPE_P(z_port) == IS_LONG
@@ -2266,7 +2266,7 @@ cluster_cmd_get_slot(redisCluster *c, zval *z_arg TSRMLS_DC)
(unsigned short)Z_LVAL_P(z_port));
/* Inform the caller if they've passed bad data */
- if(slot < 0) {
+ if(slot < 0) {
php_error_docref(0 TSRMLS_CC, E_WARNING, "Unknown node %s:%ld",
Z_STRVAL_P(z_host), Z_LVAL_P(z_port));
}
@@ -2281,12 +2281,12 @@ cluster_cmd_get_slot(redisCluster *c, zval *z_arg TSRMLS_DC)
/* Generic handler for things we want directed at a given node, like SAVE,
* BGSAVE, FLUSHDB, FLUSHALL, etc */
-static void
-cluster_empty_node_cmd(INTERNAL_FUNCTION_PARAMETERS, char *kw,
+static void
+cluster_empty_node_cmd(INTERNAL_FUNCTION_PARAMETERS, char *kw,
REDIS_REPLY_TYPE reply_type, cluster_cb cb)
{
redisCluster *c = GET_CONTEXT();
- char *cmd;
+ char *cmd;
int cmd_len;
zval *z_arg;
short slot;
@@ -2323,7 +2323,7 @@ cluster_empty_node_cmd(INTERNAL_FUNCTION_PARAMETERS, char *kw,
/* Generic routine for handling various commands which need to be directed at
* a node, but have complex syntax. We simply parse out the arguments and send
* the command as constructed by the caller */
-static void cluster_raw_cmd(INTERNAL_FUNCTION_PARAMETERS, char *kw, int kw_len)
+static void cluster_raw_cmd(INTERNAL_FUNCTION_PARAMETERS, char *kw, int kw_len)
{
redisCluster *c = GET_CONTEXT();
smart_string cmd = {0};
@@ -2387,11 +2387,11 @@ static void cluster_raw_cmd(INTERNAL_FUNCTION_PARAMETERS, char *kw, int kw_len)
}
/* Generic method for HSCAN, SSCAN, and ZSCAN */
-static void cluster_kscan_cmd(INTERNAL_FUNCTION_PARAMETERS,
+static void cluster_kscan_cmd(INTERNAL_FUNCTION_PARAMETERS,
REDIS_SCAN_TYPE type)
{
redisCluster *c = GET_CONTEXT();
- char *cmd, *pat=NULL, *key=NULL;
+ char *cmd, *pat=NULL, *key=NULL;
strlen_t key_len = 0, pat_len = 0;
int cmd_len, key_free=0;
short slot;
@@ -2408,7 +2408,7 @@ static void cluster_kscan_cmd(INTERNAL_FUNCTION_PARAMETERS,
}
/* Parse arguments */
- if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/|s!l", &key,
+ if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/|s!l", &key,
&key_len, &z_it, &pat, &pat_len, &count)==FAILURE)
{
RETURN_FALSE;
@@ -2439,11 +2439,11 @@ static void cluster_kscan_cmd(INTERNAL_FUNCTION_PARAMETERS,
if (Z_TYPE_P(return_value) == IS_ARRAY) {
zval_dtor(return_value);
ZVAL_NULL(return_value);
- }
-
+ }
+
// Create command
cmd_len = redis_fmt_scan_cmd(&cmd, type, key, key_len, it, pat, pat_len,
- count);
+ count);
// Send it off
if(cluster_send_command(c, slot, cmd, cmd_len TSRMLS_CC)==FAILURE)
@@ -2456,7 +2456,7 @@ static void cluster_kscan_cmd(INTERNAL_FUNCTION_PARAMETERS,
}
// Read response
- if(cluster_scan_resp(INTERNAL_FUNCTION_PARAM_PASSTHRU, c, type,
+ if(cluster_scan_resp(INTERNAL_FUNCTION_PARAM_PASSTHRU, c, type,
&it)==FAILURE)
{
zend_throw_exception(redis_cluster_exception_ce,
@@ -2503,7 +2503,7 @@ PHP_METHOD(RedisCluster, scan) {
}
/* Parse arguments */
- if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/z|s!l", &z_it,
+ if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/z|s!l", &z_it,
&z_node, &pat, &pat_len, &count)==FAILURE)
{
RETURN_FALSE;
@@ -2527,17 +2527,17 @@ PHP_METHOD(RedisCluster, scan) {
zval_dtor(return_value);
ZVAL_NULL(return_value);
}
-
+
/* Construct our command */
cmd_len = redis_fmt_scan_cmd(&cmd, TYPE_SCAN, NULL, 0, it, pat, pat_len,
count);
-
+
if((slot = cluster_cmd_get_slot(c, z_node TSRMLS_CC))<0) {
RETURN_FALSE;
}
// Send it to the node in question
- if(cluster_send_command(c, slot, cmd, cmd_len TSRMLS_CC)<0)
+ if(cluster_send_command(c, slot, cmd, cmd_len TSRMLS_CC)<0)
{
zend_throw_exception(redis_cluster_exception_ce,
"Couldn't send SCAN to node", 0 TSRMLS_CC);
@@ -2589,10 +2589,10 @@ PHP_METHOD(RedisCluster, save) {
}
/* }}} */
-/* {{{ proto RedisCluster::bgsave(string key)
+/* {{{ proto RedisCluster::bgsave(string key)
* proto RedisCluster::bgsave(string host, long port) */
PHP_METHOD(RedisCluster, bgsave) {
- cluster_empty_node_cmd(INTERNAL_FUNCTION_PARAM_PASSTHRU, "BGSAVE",
+ cluster_empty_node_cmd(INTERNAL_FUNCTION_PARAM_PASSTHRU, "BGSAVE",
TYPE_LINE, cluster_bool_resp);
}
/* }}} */
@@ -2703,12 +2703,12 @@ PHP_METHOD(RedisCluster, client) {
cluster_cb cb;
/* Parse args */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs|s", &z_node, &opt,
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs|s", &z_node, &opt,
&opt_len, &arg, &arg_len)==FAILURE)
{
RETURN_FALSE;
}
-
+
/* Make sure we can properly resolve the slot */
slot = cluster_cmd_get_slot(c, z_node TSRMLS_CC);
if(slot<0) RETURN_FALSE;
@@ -2718,7 +2718,7 @@ PHP_METHOD(RedisCluster, client) {
rtype = CLUSTER_IS_ATOMIC(c) ? TYPE_BULK : TYPE_LINE;
cb = cluster_client_list_resp;
} else if ((opt_len == 4 && !strncasecmp(opt, "kill", 4)) ||
- (opt_len == 7 && !strncasecmp(opt, "setname", 7)))
+ (opt_len == 7 && !strncasecmp(opt, "setname", 7)))
{
rtype = TYPE_LINE;
cb = cluster_bool_resp;
@@ -2764,14 +2764,14 @@ PHP_METHOD(RedisCluster, client) {
/* {{{ proto mixed RedisCluster::cluster(variant) */
PHP_METHOD(RedisCluster, cluster) {
- cluster_raw_cmd(INTERNAL_FUNCTION_PARAM_PASSTHRU, "CLUSTER",
+ cluster_raw_cmd(INTERNAL_FUNCTION_PARAM_PASSTHRU, "CLUSTER",
sizeof("CLUSTER")-1);
}
/* }}} */
/* }}} */
-/* {{{ proto mixed RedisCluster::config(string key, ...)
+/* {{{ proto mixed RedisCluster::config(string key, ...)
* proto mixed RedisCluster::config(array host_port, ...) */
PHP_METHOD(RedisCluster, config) {
cluster_raw_cmd(INTERNAL_FUNCTION_PARAM_PASSTHRU, "CONFIG",
@@ -2787,7 +2787,7 @@ PHP_METHOD(RedisCluster, pubsub) {
}
/* }}} */
-/* {{{ proto mixed RedisCluster::script(string key, ...)
+/* {{{ proto mixed RedisCluster::script(string key, ...)
* proto mixed RedisCluster::script(array host_port, ...) */
PHP_METHOD(RedisCluster, script) {
redisCluster *c = GET_CONTEXT();
@@ -2918,7 +2918,7 @@ PHP_METHOD(RedisCluster, echo) {
int cmd_len;
strlen_t msg_len;
short slot;
-
+
if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs", &z_arg, &msg,
&msg_len)==FAILURE)
{
@@ -2952,7 +2952,7 @@ PHP_METHOD(RedisCluster, echo) {
} else {
void *ctx = NULL;
CLUSTER_ENQUEUE_RESPONSE(c, slot, cluster_bulk_resp, ctx);
- }
+ }
efree(cmd);
}
@@ -2981,7 +2981,7 @@ PHP_METHOD(RedisCluster, rawcommand) {
efree(z_args);
RETURN_FALSE;
} else if (redis_build_raw_cmd(&z_args[1], argc-1, &cmd, &cmd_len TSRMLS_CC) ||
- (slot = cluster_cmd_get_slot(c, &z_args[0] TSRMLS_CC))<0)
+ (slot = cluster_cmd_get_slot(c, &z_args[0] TSRMLS_CC))<0)
{
if (cmd) efree(cmd);
efree(z_args);