Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ed10f36

Browse files
author
patricio.dorantes
committed
fix redis session standalone stream ssl context
1 parent 8159048 commit ed10f36

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

redis_session.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ static void lock_release(RedisSock *redis_sock, redis_session_lock_status *lock_
380380
PS_OPEN_FUNC(redis)
381381
{
382382
php_url *url;
383-
zval params;
383+
zval params, *context;
384384
int i, j, path_len;
385385

386386
redis_pool *pool = ecalloc(1, sizeof(*pool));
@@ -451,6 +451,7 @@ PS_OPEN_FUNC(redis)
451451
REDIS_CONF_AUTH_STATIC(ht, "auth", &user, &pass);
452452

453453
zval_dtor(&params);
454+
context = REDIS_HASH_STR_FIND_TYPE_STATIC(ht, "stream", IS_ARRAY);
454455
}
455456

456457
if ((url->path == NULL && url->host == NULL) || weight <= 0 || timeout <= 0) {
@@ -490,6 +491,10 @@ PS_OPEN_FUNC(redis)
490491
persistent, persistent_id ? ZSTR_VAL(persistent_id) : NULL,
491492
retry_interval);
492493

494+
if (context != NULL) {
495+
redis_sock_set_stream_context(redis_sock, context);
496+
}
497+
493498
redis_pool_add(pool, redis_sock, weight, db);
494499
redis_sock->prefix = prefix;
495500
redis_sock_set_auth(redis_sock, user, pass);

0 commit comments

Comments
 (0)