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>2020-03-12 01:21:21 +0300
committerPavlo Yatsukhnenko <yatsukhnenko@gmail.com>2020-03-30 22:34:12 +0300
commit35372a1f64f643cf4ce52c62c61e326e7d6a1e6e (patch)
tree1cd831de9e4ddabbb424171c9b7b9e29625d774e /redis_array.c
parente37f38a39eb4bece8f49ebd0652112dc992084a0 (diff)
Authenticate in redis_sock_server_open
Diffstat (limited to 'redis_array.c')
-rw-r--r--redis_array.c29
1 files changed, 7 insertions, 22 deletions
diff --git a/redis_array.c b/redis_array.c
index f5ada276..7f8fa129 100644
--- a/redis_array.c
+++ b/redis_array.c
@@ -220,21 +220,6 @@ redis_array_get(zval *id)
return NULL;
}
-PHP_REDIS_API int
-ra_call_user_function(HashTable *function_table, zval *object, zval *function_name, zval *retval_ptr, uint32_t param_count, zval params[])
-{
- if (object) {
- redis_object *redis = PHPREDIS_ZVAL_GET_OBJECT(redis_object, object);
- if (redis->sock->auth &&
- redis->sock->status != REDIS_SOCK_STATUS_CONNECTED &&
- redis_sock_server_open(redis->sock) == SUCCESS
- ) {
- redis_sock_auth(redis->sock);
- }
- }
- return call_user_function(function_table, object, function_name, retval_ptr, param_count, params);
-}
-
/* {{{ proto RedisArray RedisArray::__construct()
Public constructor */
PHP_METHOD(RedisArray, __construct)
@@ -417,7 +402,7 @@ ra_forward_call(INTERNAL_FUNCTION_PARAMETERS, RedisArray *ra, const char *cmd, i
/* multi/exec */
if(ra->z_multi_exec) {
- ra_call_user_function(&redis_ce->function_table, ra->z_multi_exec, &z_fun, return_value, argc, z_callargs);
+ call_user_function(&redis_ce->function_table, ra->z_multi_exec, &z_fun, return_value, argc, z_callargs);
zval_dtor(return_value);
zval_dtor(&z_fun);
for (i = 0; i < argc; ++i) {
@@ -435,7 +420,7 @@ ra_forward_call(INTERNAL_FUNCTION_PARAMETERS, RedisArray *ra, const char *cmd, i
/* add MULTI + SADD */
ra_index_multi(redis_inst, MULTI);
/* call using discarded temp value and extract exec results after. */
- ra_call_user_function(&redis_ce->function_table, redis_inst, &z_fun, return_value, argc, z_callargs);
+ call_user_function(&redis_ce->function_table, redis_inst, &z_fun, return_value, argc, z_callargs);
zval_dtor(return_value);
/* add keys to index. */
@@ -444,7 +429,7 @@ ra_forward_call(INTERNAL_FUNCTION_PARAMETERS, RedisArray *ra, const char *cmd, i
/* call EXEC */
ra_index_exec(redis_inst, return_value, 0);
} else { /* call directly through. */
- ra_call_user_function(&redis_ce->function_table, redis_inst, &z_fun, return_value, argc, z_callargs);
+ call_user_function(&redis_ce->function_table, redis_inst, &z_fun, return_value, argc, z_callargs);
if (!b_write_cmd) {
/* check if we have an error. */
@@ -662,7 +647,7 @@ multihost_distribute_call(RedisArray *ra, zval *return_value, zval *z_fun, int a
/* Iterate our RedisArray nodes */
for (i = 0; i < ra->count; ++i) {
/* Call each node in turn */
- ra_call_user_function(&redis_array_ce->function_table, &ra->redis[i], z_fun, &z_tmp, argc, argv);
+ call_user_function(&redis_array_ce->function_table, &ra->redis[i], z_fun, &z_tmp, argc, argv);
/* Add the result for this host */
add_assoc_zval_ex(return_value, ZSTR_VAL(ra->hosts[i]), ZSTR_LEN(ra->hosts[i]), &z_tmp);
@@ -975,7 +960,7 @@ PHP_METHOD(RedisArray, mget)
/* prepare call */
ZVAL_STRINGL(&z_fun, "MGET", 4);
/* call MGET on the node */
- ra_call_user_function(&redis_ce->function_table, &ra->redis[n], &z_fun, &z_ret, 1, &z_argarray);
+ call_user_function(&redis_ce->function_table, &ra->redis[n], &z_fun, &z_ret, 1, &z_argarray);
zval_dtor(&z_fun);
/* cleanup args array */
@@ -1119,7 +1104,7 @@ PHP_METHOD(RedisArray, mset)
ZVAL_STRINGL(&z_fun, "MSET", 4);
/* call */
- ra_call_user_function(&redis_ce->function_table, &ra->redis[n], &z_fun, &z_ret, 1, &z_argarray);
+ call_user_function(&redis_ce->function_table, &ra->redis[n], &z_fun, &z_ret, 1, &z_argarray);
zval_dtor(&z_fun);
zval_dtor(&z_ret);
@@ -1251,7 +1236,7 @@ static void ra_generic_del(INTERNAL_FUNCTION_PARAMETERS, char *kw, int kw_len) {
}
/* call */
- ra_call_user_function(&redis_ce->function_table, &ra->redis[n], &z_fun, &z_ret, 1, &z_argarray);
+ call_user_function(&redis_ce->function_table, &ra->redis[n], &z_fun, &z_ret, 1, &z_argarray);
if(ra->index) {
zval_dtor(&z_ret);