Skip to content

Commit

Permalink
Issue #1782
Browse files Browse the repository at this point in the history
Allow to specify stream context for rediscluster session handler.
  • Loading branch information
yatsukhnenko committed Sep 8, 2020
1 parent f5c6fb0 commit a8daaff
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion redis_session.c
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ static char *cluster_session_key(redisCluster *c, const char *key, int keylen,

PS_OPEN_FUNC(rediscluster) {
redisCluster *c;
zval z_conf, *zv;
zval z_conf, *zv, *context;
HashTable *ht_conf, *ht_seeds;
double timeout = 0, read_timeout = 0;
int persistent = 0, failover = REDIS_FAILOVER_NONE;
Expand Down Expand Up @@ -932,6 +932,10 @@ PS_OPEN_FUNC(rediscluster) {

redis_sock_set_auth(c->flags, user, pass);

if ((context = REDIS_HASH_STR_FIND_TYPE_STATIC(ht_conf, "stream", IS_ARRAY)) != NULL) {
redis_sock_set_stream_context(c->flags, context);
}

/* First attempt to load from cache */
if (CLUSTER_CACHING_ENABLED()) {
hash = cluster_hash_seeds(seeds, nseeds);
Expand Down

0 comments on commit a8daaff

Please sign in to comment.