Skip to content

Commit 81c502a

Browse files
authored
1 parent 950e8de commit 81c502a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

redis_sentinel.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,12 @@ PHP_METHOD(RedisSentinel, __construct)
5555
zend_long port = 26379, retry_interval = 0;
5656
redis_sentinel_object *obj;
5757
zend_string *host;
58-
zval *zv = NULL;
58+
zval *auth = NULL, *zv = NULL;
5959

60-
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|ldz!ld",
60+
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|ldz!ldz",
6161
&host, &port, &timeout, &zv,
62-
&retry_interval, &read_timeout) == FAILURE) {
62+
&retry_interval, &read_timeout,
63+
&auth) == FAILURE) {
6364
RETURN_FALSE;
6465
}
6566

@@ -96,6 +97,9 @@ PHP_METHOD(RedisSentinel, __construct)
9697
obj = PHPREDIS_ZVAL_GET_OBJECT(redis_sentinel_object, getThis());
9798
obj->sock = redis_sock_create(ZSTR_VAL(host), ZSTR_LEN(host), port,
9899
timeout, read_timeout, persistent, persistent_id, retry_interval);
100+
if (auth) {
101+
redis_sock_set_auth_zval(obj->sock, auth);
102+
}
99103
}
100104

101105
PHP_METHOD(RedisSentinel, ckquorum)

0 commit comments

Comments
 (0)