Skip to content

Commit a8daaff

Browse files
committed
Issue #1782
Allow to specify stream context for rediscluster session handler.
1 parent f5c6fb0 commit a8daaff

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

redis_session.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,7 @@ static char *cluster_session_key(redisCluster *c, const char *key, int keylen,
854854

855855
PS_OPEN_FUNC(rediscluster) {
856856
redisCluster *c;
857-
zval z_conf, *zv;
857+
zval z_conf, *zv, *context;
858858
HashTable *ht_conf, *ht_seeds;
859859
double timeout = 0, read_timeout = 0;
860860
int persistent = 0, failover = REDIS_FAILOVER_NONE;
@@ -932,6 +932,10 @@ PS_OPEN_FUNC(rediscluster) {
932932

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

935+
if ((context = REDIS_HASH_STR_FIND_TYPE_STATIC(ht_conf, "stream", IS_ARRAY)) != NULL) {
936+
redis_sock_set_stream_context(c->flags, context);
937+
}
938+
935939
/* First attempt to load from cache */
936940
if (CLUSTER_CACHING_ENABLED()) {
937941
hash = cluster_hash_seeds(seeds, nseeds);

0 commit comments

Comments
 (0)