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:
authorMichael Grunder <michael.grunder@gmail.com>2020-09-28 21:07:46 +0300
committerGitHub <noreply@github.com>2020-09-28 21:07:46 +0300
commit950e8de807ba17ecfff62504a6ee7a959a5df714 (patch)
treeb74010cca8baeb173be3edf216e66aa3e18b5f83 /redis_commands.c
parent7e5191fb5645296b9e852fab7991820c1eaf0422 (diff)
Issue.1847 cluster segfault (#1850)
Fix for #1847 when dealing with NULL multi bulk replies in RedisCluster. Adds `Redis::OPT_NULL_MULTIBULK_AS_NULL` setting to have PhpRedis treat NULL multi bulk replies as `NULL` instead of `[]`. Co-authored-by: Alex Offshore <offshore@aopdg.ru>
Diffstat (limited to 'redis_commands.c')
-rw-r--r--redis_commands.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/redis_commands.c b/redis_commands.c
index d6bb2bcf..07f409c7 100644
--- a/redis_commands.c
+++ b/redis_commands.c
@@ -3996,6 +3996,8 @@ void redis_getoption_handler(INTERNAL_FUNCTION_PARAMETERS,
RETURN_LONG(redis_sock->scan);
case REDIS_OPT_REPLY_LITERAL:
RETURN_LONG(redis_sock->reply_literal);
+ case REDIS_OPT_NULL_MBULK_AS_NULL:
+ RETURN_LONG(redis_sock->null_mbulk_as_null);
case REDIS_OPT_FAILOVER:
RETURN_LONG(c->failover);
default:
@@ -4040,6 +4042,10 @@ void redis_setoption_handler(INTERNAL_FUNCTION_PARAMETERS,
val_long = zval_get_long(val);
redis_sock->reply_literal = val_long != 0;
RETURN_TRUE;
+ case REDIS_OPT_NULL_MBULK_AS_NULL:
+ val_long = zval_get_long(val);
+ redis_sock->null_mbulk_as_null = val_long != 0;
+ RETURN_TRUE;
case REDIS_OPT_COMPRESSION:
val_long = zval_get_long(val);
if (val_long == REDIS_COMPRESSION_NONE