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>2019-01-15 11:07:30 +0300
committerPavel Yatsukhnenko <p.yatsukhnenko@digitalscreens.com.ua>2019-01-18 00:05:52 +0300
commitc5994f2a42b8a348af92d3acb4edff1328ad8ce1 (patch)
treeb2f4cdc3d7986860ef4bf5e311001820cb57bd2b /library.c
parente145f8582ab9aa5bb6e986298be2e47d8063c8a0 (diff)
RedisCluster auth
Diffstat (limited to 'library.c')
-rw-r--r--library.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/library.c b/library.c
index 79015d4b..93a44600 100644
--- a/library.c
+++ b/library.c
@@ -90,7 +90,9 @@ static int reselect_db(RedisSock *redis_sock TSRMLS_DC) {
}
/* Helper to resend AUTH <password> in the case of a reconnect */
-static int resend_auth(RedisSock *redis_sock TSRMLS_DC) {
+PHP_REDIS_API int
+redis_sock_auth(RedisSock *redis_sock TSRMLS_DC)
+{
char *cmd, *response;
int cmd_len, response_len;
@@ -205,7 +207,7 @@ redis_check_eof(RedisSock *redis_sock, int no_throw TSRMLS_DC)
errno = 0;
if (php_stream_eof(redis_sock->stream) == 0) {
/* If we're using a password, attempt a reauthorization */
- if (redis_sock->auth && resend_auth(redis_sock TSRMLS_CC) != 0) {
+ if (redis_sock->auth && redis_sock_auth(redis_sock TSRMLS_CC) != 0) {
errmsg = "AUTH failed while reconnecting";
break;
}