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@users.noreply.github.com>2020-09-28 21:08:45 +0300
committerGitHub <noreply@github.com>2020-09-28 21:08:45 +0300
commit81c502ae7c0de65d63cd514ee59849c9d1b0b952 (patch)
tree8cb42a4042a248c07f58276a230bb0343eaa975c /redis_sentinel.c
parent950e8de807ba17ecfff62504a6ee7a959a5df714 (diff)
Issue #1839 (#1854)
Diffstat (limited to 'redis_sentinel.c')
-rw-r--r--redis_sentinel.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/redis_sentinel.c b/redis_sentinel.c
index 9fa5414d..cbdf331c 100644
--- a/redis_sentinel.c
+++ b/redis_sentinel.c
@@ -55,11 +55,12 @@ PHP_METHOD(RedisSentinel, __construct)
zend_long port = 26379, retry_interval = 0;
redis_sentinel_object *obj;
zend_string *host;
- zval *zv = NULL;
+ zval *auth = NULL, *zv = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|ldz!ld",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|ldz!ldz",
&host, &port, &timeout, &zv,
- &retry_interval, &read_timeout) == FAILURE) {
+ &retry_interval, &read_timeout,
+ &auth) == FAILURE) {
RETURN_FALSE;
}
@@ -96,6 +97,9 @@ PHP_METHOD(RedisSentinel, __construct)
obj = PHPREDIS_ZVAL_GET_OBJECT(redis_sentinel_object, getThis());
obj->sock = redis_sock_create(ZSTR_VAL(host), ZSTR_LEN(host), port,
timeout, read_timeout, persistent, persistent_id, retry_interval);
+ if (auth) {
+ redis_sock_set_auth_zval(obj->sock, auth);
+ }
}
PHP_METHOD(RedisSentinel, ckquorum)