From 81c502ae7c0de65d63cd514ee59849c9d1b0b952 Mon Sep 17 00:00:00 2001 From: Pavlo Yatsukhnenko Date: Mon, 28 Sep 2020 21:08:45 +0300 Subject: Issue #1839 (#1854) --- redis_sentinel.c | 10 +++++++--- 1 file 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) -- cgit v1.2.3