diff options
-rw-r--r-- | cluster_library.c | 27 | ||||
-rw-r--r-- | redis_cluster.c | 19 |
2 files changed, 23 insertions, 23 deletions
diff --git a/cluster_library.c b/cluster_library.c index 36ce2628..373d806c 100644 --- a/cluster_library.c +++ b/cluster_library.c @@ -340,7 +340,7 @@ int cluster_dist_add_key(redisCluster *c, HashTable *ht, char *key, /* Provided a clusterKeyVal, add a value */ void cluster_dist_add_val(redisCluster *c, clusterKeyVal *kv, zval *z_val - TSRMLS_CC) + TSRMLS_DC) { char *val; int val_len, val_free; @@ -513,13 +513,13 @@ clusterReply* cluster_get_slots(RedisSock *redis_sock TSRMLS_DC) // Send the command to the socket and consume reply type if(redis_sock_write(redis_sock, RESP_CLUSTER_SLOTS_CMD, sizeof(RESP_CLUSTER_SLOTS_CMD)-1 TSRMLS_CC)<0 || - redis_read_reply_type(redis_sock, &type, &len)<0) + redis_read_reply_type(redis_sock, &type, &len TSRMLS_CC)<0) { return NULL; } // Consume the rest of our response - if((r = cluster_read_sock_resp(redis_sock, type, len))==NULL || + if((r = cluster_read_sock_resp(redis_sock, type, len TSRMLS_CC))==NULL || r->type != TYPE_MULTIBULK || r->elements < 3) { if(r) cluster_free_reply(r, 1); @@ -651,11 +651,10 @@ PHPAPI void cluster_free_node(redisClusterNode *node) { * bounce us back and forth until the slots have migrated */ static int cluster_send_asking(RedisSock *redis_sock TSRMLS_DC) { - REDIS_REPLY_TYPE reply_type; char buf[255]; // Make sure we can send the request - if(redis_check_eof(redis_sock, 1 TSRMLS_DC) || + if(redis_check_eof(redis_sock, 1 TSRMLS_CC) || php_stream_write(redis_sock->stream, RESP_ASKING_CMD, sizeof(RESP_ASKING_CMD)-1) != sizeof(RESP_ASKING_CMD)-1) { @@ -664,9 +663,7 @@ static int cluster_send_asking(RedisSock *redis_sock TSRMLS_DC) // Read our reply type if((redis_check_eof(redis_sock, 1 TSRMLS_CC) == - 1) || - (reply_type = php_stream_getc(redis_sock->stream TSRMLS_DC) - != TYPE_LINE)) - { + (php_stream_getc(redis_sock->stream) != TYPE_LINE)) { return -1; } @@ -883,7 +880,7 @@ static int cluster_check_response(redisCluster *c, unsigned short slot, // Fetch the first line of our response from Redis. if(redis_sock_gets(SLOT_SOCK(c,slot),c->line_reply,sizeof(c->line_reply), - &sz)<0) + &sz TSRMLS_CC)<0) { return -1; } @@ -927,7 +924,7 @@ static int cluster_sock_write(redisCluster *c, unsigned short slot, if(c->redir_type != REDIR_ASK) { redis_sock = SLOT_SOCK(c,slot); } else { - redis_sock = cluster_get_asking_sock(c); + redis_sock = cluster_get_asking_sock(c TSRMLS_CC); // Redis Cluster wants this command preceded by the "ASKING" command if(cluster_send_asking(redis_sock TSRMLS_CC)<0) { @@ -1001,7 +998,7 @@ static redisClusterNode *cluster_find_node(redisCluster *c, const char *host, /* Provided a redisCluster object, the slot where we thought data was and * the slot where data was moved, update our node mapping */ -static void cluster_update_slot(redisCluster *c TSRMLS_CC) { +static void cluster_update_slot(redisCluster *c TSRMLS_DC) { redisClusterNode *node; // Do we already have the new slot mapped @@ -1229,7 +1226,7 @@ PHPAPI short cluster_send_command(redisCluster *c, short slot, const char *cmd, // In case of a MOVED redirection, update our node mapping if(c->redir_type == REDIR_MOVED) { - cluster_update_slot(c); + cluster_update_slot(c TSRMLS_CC); } slot = c->redir_slot; } @@ -1303,7 +1300,7 @@ PHPAPI void cluster_bulk_resp(INTERNAL_FUNCTION_PARAMETERS, redisCluster *c, } // Return the string if we can unserialize it - if(redis_unserialize(c->flags, resp, c->reply_len, &z_ret)==0) { + if(redis_unserialize(c->flags, resp, c->reply_len, &z_ret TSRMLS_CC)==0) { CLUSTER_RETURN_STRING(c, resp, c->reply_len); } else { if(CLUSTER_IS_ATOMIC(c)) { @@ -1833,7 +1830,9 @@ PHPAPI zval *cluster_zval_mbulk_resp(INTERNAL_FUNCTION_PARAMETERS, array_init(z_result); // Call our callback - if(cb(SLOT_SOCK(c,c->reply_slot), z_result, c->reply_len, NULL)==FAILURE) { + if(cb(SLOT_SOCK(c,c->reply_slot), z_result, c->reply_len, NULL TSRMLS_CC) + ==FAILURE) + { zval_dtor(z_result); FREE_ZVAL(z_result); return NULL; diff --git a/redis_cluster.c b/redis_cluster.c index a175a8e8..12c5682e 100644 --- a/redis_cluster.c +++ b/redis_cluster.c @@ -502,7 +502,8 @@ static int get_key_val_ht(redisCluster *c, HashTable *ht, HashPosition *ptr, } // Serialize our value if required - kv->val_free = redis_serialize(c->flags,*z_val,&(kv->val),&(kv->val_len)); + kv->val_free = redis_serialize(c->flags,*z_val,&(kv->val),&(kv->val_len) + TSRMLS_CC); // Success return 0; @@ -1639,8 +1640,8 @@ 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) - ==FAILURE) + if(cluster_send_slot(c, c->subscribed_slot, cmd, cmd_len, TYPE_MULTIBULK + TSRMLS_CC) ==FAILURE) { zend_throw_exception(redis_cluster_exception_ce, "Failed to UNSUBSCRIBE within our subscribe loop!", 0 TSRMLS_CC); @@ -2080,7 +2081,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) +cluster_cmd_get_slot(redisCluster *c, zval *z_arg TSRMLS_DC) { short slot; @@ -2140,7 +2141,7 @@ cluster_empty_node_cmd(INTERNAL_FUNCTION_PARAMETERS, char *kw, // One argument means find the node (treated like a key), and two means // send the command to a specific host and port - slot = cluster_cmd_get_slot(c, z_arg); + slot = cluster_cmd_get_slot(c, z_arg TSRMLS_CC); if(slot<0) { RETURN_FALSE; } @@ -2198,7 +2199,7 @@ static void cluster_raw_cmd(INTERNAL_FUNCTION_PARAMETERS, char *kw, int kw_len) } /* First argument needs to be the "where" */ - if((slot = cluster_cmd_get_slot(c, z_args[0]))<0) { + if((slot = cluster_cmd_get_slot(c, z_args[0] TSRMLS_CC))<0) { RETURN_FALSE; } @@ -2358,7 +2359,7 @@ PHP_METHOD(RedisCluster, scan) { 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))<0) { + if((slot = cluster_cmd_get_slot(c, z_node TSRMLS_CC))<0) { RETURN_FALSE; } @@ -2481,7 +2482,7 @@ PHP_METHOD(RedisCluster, info) { /* Treat INFO as non read-only, as we probably want the master */ c->readonly = 0; - slot = cluster_cmd_get_slot(c, z_arg); + slot = cluster_cmd_get_slot(c, z_arg TSRMLS_CC); if(slot<0) { RETURN_FALSE; } @@ -2603,7 +2604,7 @@ PHP_METHOD(RedisCluster, echo) { c->readonly = CLUSTER_IS_ATOMIC(c); /* Grab slot either by key or host/port */ - slot = cluster_cmd_get_slot(c, z_arg); + slot = cluster_cmd_get_slot(c, z_arg TSRMLS_CC); if(slot<0) { RETURN_FALSE; } |